<% @divisions.each do |division| %>
  <td class="user_radio"><%= radio_button_tag("division_ids[]", division.id, false, :onClick=> 'redirect_to edit_division_path(division)')%></td>
  /* rest of the elements in the division */
  <% end %>

I need that on clicking the radio button the page gets redirected to the edit_division_path for the division being clicked.

But nothing happens. No error or anything else..

What am I doing wrong?

I am using rails 3..

有帮助吗?

解决方案

onClick is a javascript thing.

What you want is something like this:

:onClick => 'location.href="' + edit_division_path(division) + '"'

其他提示

onclick = "document.location.href='somepage.htm'"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top