Ruby on Rails Monday, May 16, 2011

html.erb

<%form_for(:person do |f|)%>
<%= check_box(:person,:permanent_employee,:options=>{},:on_value =>
"1",:off_value => "0")%>
<%end>

controller
edit_method
----
@person=Person.find_by_id(params[:id])
@person.update_attributes(params[::person])
@person.permanent = params[:person][:permanent_employee]
@person.save

I believe. it is work

--
Posted via http://www.ruby-forum.com/.

--
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