[00:40:27]  dddadacha (ddadacha@nat/redhat/x-czatfvvdeexynijh) joined #markus.
 [00:42:51]  xddadacha (ddadacha@nat/redhat/x-fiaoeyuntqaxignr) left irc: Ping timeout: 252 seconds
 [04:24:02]  ddadacha (ddadacha@nat/redhat/x-gpmdyjqxomqthtpu) joined #markus.
 [04:26:10]  dddadacha (ddadacha@nat/redhat/x-czatfvvdeexynijh) left irc: Ping timeout: 244 seconds
 [13:32:06]  dddadacha (~ddadacha@gw-wifi8.cdf.toronto.edu) joined #markus.
 [15:10:31]  tobioboye (~drone@gw-wifi4.cdf.toronto.edu) joined #markus.
 [15:37:12]  dddadacha (~ddadacha@gw-wifi8.cdf.toronto.edu) got netsplit.
 [15:38:22]  77CAAIAZO (~ddadacha@gw-wifi8.cdf.toronto.edu) joined #markus.
 [15:39:12]  Nick change: 77CAAIAZO -> danesh
 [15:40:41]  ddadacha (ddadacha@nat/redhat/x-gpmdyjqxomqthtpu) left irc: Disconnected by services
 [15:40:45]  Nick change: danesh -> ddadacha
 [15:41:28]  dddadacha (ddadacha@nat/redhat/x-fmipascxpplbpqnu) joined #markus.
 [16:08:45]  Nick change: m_conley_away -> m_conley
 [16:14:13]  ddadacha (~ddadacha@gw-wifi8.cdf.toronto.edu) left irc: Ping timeout: 252 seconds
 [16:29:01]  ddadacha (~ddadacha@gw-wifi12.cdf.utoronto.ca) joined #markus.
 [16:31:11]  ddadacha (~ddadacha@gw-wifi12.cdf.utoronto.ca) left irc: Client Quit
 [16:32:49]  tobioboye (~drone@gw-wifi4.cdf.toronto.edu) left irc: Quit: tobioboye
 [17:00:19]  tobioboye (~drone@gw-wifi4.cdf.utoronto.ca) joined #markus.
 [17:01:54]  ddadacha (~ddadacha@gw-wifi12.cdf.utoronto.ca) joined #markus.
 [17:46:00] <ddadacha>  tobioboye: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
 [18:35:02]  ChristineY (~cyu@d50-92-22-179.bchsia.telus.net) joined #markus.
 [18:57:54]  Ayaya-Aaron-MBP (~Ayaya-Aar@S010600035203676e.vc.shawcable.net) joined #markus.
 [19:06:19] <ddadacha>  m_conley: ping
 [19:07:42] <m_conley>  ddadacha: hey - about to head out - can you send me mail?
 [19:08:22] <ddadacha>  nah it's okay, just wanted to know if this thing was implemented/if you'd ever seen it
 [19:08:24] <ddadacha>  no worries
 [19:08:45] <m_conley>  ddadacha: which thing?
 [19:09:33] <Ayaya-Aaron-MBP>  hello =)
 [19:09:34] <ddadacha>  when you're viewing a submission (as admin/grader), under the summary tab, there's this bit for "Extra Percentage"
 [19:09:50] <ddadacha>  m_conley: I can't find (in demo even) how to add a percentage as you can add a mark
 [19:09:51] <ddadacha>  Ayaya-Aaron-MBP: hey!
 [19:10:14] <ddadacha>  m_conley: any idea if it was ever there? :/ Also please head out if you have to!
 [19:10:27] <ddadacha>  m_conley: http://demo.markusproject.org/en/main/results/edit/218
 [19:10:31] <ddadacha>  (login as admin)
 [19:10:32] <m_conley>  ddadacha: yeah, sorry, can't remember off the top of my head. :/
 [19:10:35] <ddadacha>  alright
 [19:10:37] <m_conley>  ddadacha: and yeah, gotta run
 [19:10:38] <m_conley>  sorry!
 [19:10:40] <ddadacha>  np!
 [19:10:45] <ddadacha>  thanks anyways =)
 [19:10:47]  Nick change: m_conley -> m_conley_away
 [19:21:44] <Ayaya-Aaron-MBP>  ddadacha: do you have any good references on how to make a button conditionally appear
 [19:22:09] <Ayaya-Aaron-MBP>  I have a partial form which which is used by more than one view
 [19:22:22] <Ayaya-Aaron-MBP>  but I want a certain button in the partial form to appear for a specific view, not all of them
 [19:23:02] <ddadacha>  Ayaya-Aaron-MBP: ah I see
 [19:23:04] <ddadacha>  Ayaya-Aaron-MBP: which function are you using to render the button?
 [19:23:11] <Ayaya-Aaron-MBP>  link_to_function
 [19:23:25] <ddadacha>  fun stuff
 [19:23:30] <Ayaya-Aaron-MBP>  ><
 [19:23:31] <ddadacha>  which view?
 [19:24:33] <Ayaya-Aaron-MBP>  students/new.html.erb
 [19:24:36] <Ayaya-Aaron-MBP>  and students/edit.html.erb
 [19:24:44] <Ayaya-Aaron-MBP>  both render the _student_form partial
 [19:24:52] <Ayaya-Aaron-MBP>  there is a button in there that I added
 [19:24:59] <Ayaya-Aaron-MBP>  I want it to only show up in /new
 [19:25:01] <Ayaya-Aaron-MBP>  but not in edit
 [19:26:16] <ddadacha>  oh you added
 [19:26:32] <ddadacha>  can you paste the link_to_function line here
 [19:26:36] <ddadacha>  or if it's long on fpaste.org
 [19:27:13] <Ayaya-Aaron-MBP>  <%= link_to_function I18n.t("section.add_section"), 'modalAddNewSection.open()', :class => "button link_button" %>
 [19:27:36] <Ayaya-Aaron-MBP>  opens a modal dialog :P
 [19:28:35] <ddadacha>  hmm so you can use link_to_if instead of link_to_function, this might throw off your modalAddNewSection.open() though
 [19:28:57] <Ayaya-Aaron-MBP>  hmm
 [19:29:23] <ddadacha>  but the problem is figuring out which one did the rendering
 [19:29:26] <ddadacha>  hmm
 [19:29:43] <Ayaya-Aaron-MBP>  hmm
 [19:32:32] <ddadacha>  k I can't think of any smart way of doing this
 [19:32:42] <ddadacha>  so just pass in a local param when rendering _student_form
 [19:32:56] <ddadacha>  Ayaya-Aaron-MBP: do you know how to pass params into the partial being rendered?
 [19:33:40] <Ayaya-Aaron-MBP>  no, I actually tried doing it earlier but couldn't get it to work :(
 [19:33:40] <ddadacha>  Ayaya-Aaron-MBP: if you can use link_to_if, I would recommend it over link_to_function - that's not as unobtrusive as we'd like
 [19:34:57] <Ayaya-Aaron-MBP>  can link_to_if make the JS call thoguh
 [19:35:00] <ddadacha>  Ayaya-Aaron-MBP: 1 sec
 [19:37:09] <ddadacha>  Ayaya-Aaron-MBP: yeah it should, http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to_if
 [19:37:16] <ddadacha>  but I've been having some trouble with it
 [19:37:24] <ddadacha>  give it a shot, if it doesn't then no worries, jsut head back
 [19:37:38] <ddadacha>  Ayaya-Aaron-MBP: so this partial should be rendered when creating a new user, right?
 [19:38:17] <Ayaya-Aaron-MBP>  yup
 [19:40:19] <ddadacha>  Ayaya-Aaron-MBP: the condition you can use is params[:action] == "new"
 [19:40:25] <ddadacha>  the views already set that up for you
 [19:41:04] <ddadacha>  Ayaya-Aaron-MBP: when rendering the view, the locals variable used as a param to render is the parameters you can pass to the partial. You then access it via the params dictionary
 [19:41:20] <ddadacha>  it's a little misleading because of the names
 [19:41:41] <Ayaya-Aaron-MBP>  where was params[:action] passed in?
 [19:41:48] <Ayaya-Aaron-MBP>  when I looks at new.html.erb
 [19:42:03] <Ayaya-Aaron-MBP>  it looks the params[:action] => 'create'
 [19:42:51] <ddadacha>  Ayaya-Aaron-MBP: so try link_to_if with ---^and then if that fails, just use a ruby if in the html
 [19:43:40] <ddadacha>  Ayaya-Aaron-MBP: ah that's also misleading :P
 [19:43:55] <ddadacha>  Ayaya-Aaron-MBP: are you familiar with RESTful API? General HTTP requests?
 [19:44:05] <Ayaya-Aaron-MBP>  general HTTP requests yes
 [19:44:13] <Ayaya-Aaron-MBP>  I would not say the same for RESTful api =(
 [19:44:34] <ddadacha>  well actually this is just HTTP so ignore that ;) So in this case, we're sending this as a CREATE request
 [19:44:50] <ddadacha>  RoR affiliates CREATE requests in controllers with the "new" action
 [19:45:03] <ddadacha>  in other words, CREATE requests redirect to the controller's new func
 [19:45:29] <Ayaya-Aaron-MBP>  aw ic
 [19:45:46] <ddadacha>  similarly, in edit.html.erb, it's 'update' as in the UPDATE request, rails will convert this into the edit action (i.e. controller.edit() )
 [19:45:55] <Ayaya-Aaron-MBP>  would params[:action] => 'create' also be true though?
 [19:46:04] <ddadacha>  Ayaya-Aaron-MBP: what I did was just added a quick debug to check the values of params
 [19:46:06] <ddadacha>  Ayaya-Aaron-MBP: no
 [19:46:22] <ddadacha>  Ayaya-Aaron-MBP: add the debugger statement in _student_form and take a look yourself
 [19:46:26] <Ayaya-Aaron-MBP>  ooh I see!
 [19:46:32] <ddadacha>  when it breaks, you might have to hit n to get from the debugger into the view
 [19:46:36] <ddadacha>  (n for next)
 [19:46:49] <ddadacha>  (rdb:16) p params
 [19:46:49] <ddadacha>  {"controller"=>"students", "action"=>"new", "locale"=>"en"}
 [19:46:51] <ddadacha>  Ayaya-Aaron-MBP: -^
 [19:47:16] <Ayaya-Aaron-MBP>  oooh
 [19:47:33] <Ayaya-Aaron-MBP>  hmm so it seems that
 [19:47:44] <Ayaya-Aaron-MBP>  link_to_if makes the link un-linkable when it is false
 [19:47:48] <Ayaya-Aaron-MBP>  and linkable when it is true
 [19:47:56] <Ayaya-Aaron-MBP>  it doesn't actually make the button disappear..
 [19:48:01] <ddadacha>  oh my mistake
 [19:48:04] <ddadacha>  you are right
 [19:48:10] <ddadacha>  so then can you use a standard ruby if
 [19:48:15] <ddadacha>  but then try it with link_to?
 [19:48:31] <ddadacha>  the point is link_to_function is not completely unobtrusive
 [19:48:53] <ddadacha>  anyway, if link_to gives you troubles, don't waste your time with it
 [19:49:31] <Ayaya-Aaron-MBP>  hmm
 [19:50:12] <Ayaya-Aaron-MBP>  so I'm suppose to be able to call a JS function with link_to
 [20:04:12] <ddadacha>  yes
 [20:04:38] <ddadacha>  these link_to* functions are basically fancy wrappers for the <a href= > tag in HTML
 [20:05:05] <ddadacha>  Ayaya-Aaron-MBP: so they _should_ work...it's just I've noticed when things get complicated (AJAX especially), they tend to do weird stuff :(
 [20:05:18] <Ayaya-Aaron-MBP>  hm
 [20:06:19] <Ayaya-Aaron-MBP>  am I passing this variable I created to the partial correctly?
 [20:06:19] <Ayaya-Aaron-MBP>  <%= render :partial => "student_form", :locals => {:action => 'create', :new_student => true} %>
 [20:06:25] <Ayaya-Aaron-MBP>  new_student is the variable
 [20:06:36] <Ayaya-Aaron-MBP>  how do I access it within the partial?
 [20:11:38] <ddadacha>  Ayaya-Aaron-MBP: you don't need to pass in anew var at all
 [20:11:42] <ddadacha>  Ayaya-Aaron-MBP: you can just use :action
 [20:11:54] <Ayaya-Aaron-MBP>  if I use :action, I would need to hardcode "new" right?
 [20:11:59] <ddadacha>  (to access it you'd do params[:new_student]
 [20:12:01] <Ayaya-Aaron-MBP>  in the check
 [20:12:03] <ddadacha>  yeah
 [20:12:13] <ddadacha>  yeah just params[:action] == "new"
 [20:12:51] <Ayaya-Aaron-MBP>  I thought it might be kind of a no-no to hardcode it :)
 [20:13:19] <Ayaya-Aaron-MBP>  I hardcoded an action in one of my calls and Severin called me out on it.. xD
 [20:13:32]  pranq (pranq@unaffiliated/contempt) left irc: Ping timeout: 240 seconds
 [20:14:34]  pranq (pranq@unaffiliated/contempt) joined #markus.
 [20:15:36] <Ayaya-Aaron-MBP>  Thanks for your help! I got it to work! :)
 [20:16:55] <ddadacha>  np!
 [20:17:21] <ddadacha>  tbh he might call you out on this
 [20:17:28] <ddadacha>  but it's how I'd do it ;)
 [20:17:41] <ddadacha>  if not then it really needs to be 2 separate partials
 [20:17:55] <ddadacha>  at the end of the day you were hard coding the new locals variable so what's the difference :P
 [20:18:49] <Ayaya-Aaron-MBP>  well because I set what variable is
 [20:18:53] <Ayaya-Aaron-MBP>  and I check that variable :)
 [20:19:05] <Ayaya-Aaron-MBP>  rather than checking :action, which I have no control over.. :D
 [20:19:52] <ddadacha>  ah true
 [20:20:20] <Ayaya-Aaron-MBP>  ddadacha: 2 separate partials would've been the easy way of doing it, but I really wanted to figure out a way to reuse the code :)
 [20:20:23] <ddadacha>  I suspect that even if you don't pass in action though, it'd be defaulted to new
 [20:20:32] <Ayaya-Aaron-MBP>  interesting
 [20:20:59] <ddadacha>  because it recognizes it's coming from a create call..but this is speculation ;)
 [20:21:06] <Ayaya-Aaron-MBP>  I'm having trouble looking up the difference between <% and <%=
 [20:21:11] <ddadacha>  Ayaya-Aaron-MBP: I would be fine with it if you used == "new"
 [20:21:24] <Ayaya-Aaron-MBP>  ddadacha: alright cool thanks :)
 [20:21:48] <ddadacha>  Ayaya-Aaron-MBP: yeah I never know that...the way I think it is is that the <% implies it is just ruby code, the <%= implies it is accessing stuff setup by rails, i.e. controller functions and whatnot
 [20:22:16] <ddadacha>  so <% is good for if params[:action] == "new"
 [20:22:23] <Ayaya-Aaron-MBP>  oh I see, yeah I kept trying to use a normal "if" conditional check with <%= and it wouldn't work!
 [20:22:25] <ddadacha>  but when you link_to, it has to be =
 [20:22:28] <Ayaya-Aaron-MBP>  yeah!
 [20:22:37] <ddadacha>  not 100% sure about tha tthough :/
 [20:22:39] <Ayaya-Aaron-MBP>  thats good to know. :)
 [20:22:47] <Ayaya-Aaron-MBP>  seems to work that way!
 [20:24:25] <ddadacha>  nice
 [20:24:28] <ddadacha>  is it working with link_to?
 [20:24:35] <ddadacha>  Ayaya-Aaron-MBP: or did you have to use _function
 [20:25:00] <Ayaya-Aaron-MBP>  I'm trying to get it to work with link_to
 [20:25:06] <Ayaya-Aaron-MBP>  I got it to work with link_to_function though
 [20:26:10] <ddadacha>  so many minor changes :/ I just realized it's there for button_to_function vs button_to
 [20:26:21]  *** ddadacha bangs head against wall and doubles back
 [20:27:17] <Ayaya-Aaron-MBP>  yeaaaaah
 [20:27:30] <Ayaya-Aaron-MBP>  go cool down via game of d2
 [20:27:45] <Ayaya-Aaron-MBP>  *an hour goes by suddenly
 [20:28:57] <ddadacha>  try 5 :P
 [20:30:15] <Ayaya-Aaron-MBP>  hahaha true
 [20:33:15]  tobioboye (~drone@gw-wifi4.cdf.utoronto.ca) left irc: Quit: tobioboye
 [20:35:17]  ddadacha (~ddadacha@gw-wifi12.cdf.utoronto.ca) left irc: Quit: bbiab
 [20:47:39]  Ayaya-Aaron-MBP (~Ayaya-Aar@S010600035203676e.vc.shawcable.net) left irc: Quit: Ayaya-Aaron-MBP
 [21:24:46]  ddadacha (~ddadacha@gw-wifi3.cdf.toronto.edu) joined #markus.
 [21:35:04] <ddadacha>  ChristineY: heh funny, I ran into that issue today
 [21:35:09] <ddadacha>  (#685)
 [21:35:23] <ddadacha>  ChristineY: commented on the issue, already have a fix (if you're looking for one)
 [22:09:51]  tobioboye (~drone@user252-55.wireless.utoronto.ca) joined #markus.
 [22:18:55]  MarkUsGithubCIA (~MarkUsGit@sh2.rs.github.com) joined #markus.
 [22:18:55] <MarkUsGithubCIA>  [Markus] jerboaa pushed 1 new commit to master: http://git.io/e-QXLw
 [22:18:55] <MarkUsGithubCIA>  [Markus/master] Fixes #284 and #426. Adds support for multiple encodings in file uploads. - Alex Krassikov
 [22:18:55]  MarkUsGithubCIA (~MarkUsGit@sh2.rs.github.com) left #markus.