We can do that with attr_accessor

In model
attr_accessible :site_id
attr_accessor :site_id


in form, add a hidden field like this

=f.site_id, value; session[:site_id]

in model we can use self.site_id now.

--
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 https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 20, '12 at 4:40a
activeNov 20, '12 at 4:40a
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Vu R.: 1 post

People

Translate

site design / logo © 2022 Grokbase