I have following view for user input:
<h1>Post new thing</h1>
<%= form_tag :action => ''create'' %>
<p><label for="thing_title">Title</label><br/>
<%= text_field ''thing'', ''title''
%></p>
<p><label
for="thing_description">Description</label><br/>
<%= text_area ''thing'', ''description''
%></p>
<p><label for="thing_email">Email</label><br/>
<%= text_field ''thing'', ''email''
%></p>
<%= submit_tag "Create" %>
<%= form_tag %>
... and following controller that populates data (one row) in database
def create
@thing = Thing.new(params[:thing])
end
So far it is working. But I need to add one more parameter to @thing
variable that doesn`t come from user input. It comes from another model
(:another_main_thing_id). What is the syntax for adding this parameter
to @thing variable.
Thank you!
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---