Ruby on Rails Monday, August 29, 2011

What is the best way to change a value on database when I change value on checkbox by ajax?

I want to put a checkbox in my list of data:

ex:

  <% @posts.each do |post| %>
   
<tr">
     
<td><%= post.id %></td>
     
<td><%= post.title %></td>

 
<td>
     
<%= button_group do %>
     
<%=  pill_button_link_to 'Edit', edit_post_path(post) %>
     
<%= pill_negative_trash_button_link_to 'Delete', post, :confirm => 'Are you sure?', :method => :delete %>
<% end %>
 
</td>

Then I want to change an boolean value from list of posts, when I change the value of checkbox, without reloading the page.

I'm looking by the best way for do this.

Thanks by help!


--
Fernando Aureliano

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment