Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in the view:
- <% Candidate::RANKS.each do |rank| -%>
- <div class='form_row'>
- <div class='label'><%= h(rank.titlecase) %></div>
- <div class='item'><%= f.radio_button(:position_rank, rank) %></div>
- </div>
- <%= observe_field("candidate_position_rank_#{rank}",
- :url => {
- :controller => 'faculty_search',
- :action => :rank_radio_button_changed,
- :id => rank},
- :with => "'radio_button_value=' + escape(value)",
- :on => "click") %>
- <% end -%>
- in the rjs:
- if Candidate::JUNIOR_RANKS.include?(@radio_button_value)
- page << "alert('junior')"
- elsif Candidate::SENIOR_RANKS.include?(@radio_button_value)
- page << "alert('senior')"
- else
- # no op
- end
- The problem:
- In the browser, the handler only gets fired the first time the thing is clicked.
Add Comment
Please, Sign In to add comment