Sorry to butt in guys, i get the feeling you're going to go round in
circles forever.
Ralu - if the user types 'foo' in the text box, params will look like
this:
params = {:resolve => {:content => "foo"}}
In the controller you need to do this:
@resolve = Resolve.new(params[:resolve])
which is the same as saying this
@resolve = Resolve.new({:content => "foo"})
which in turn, effectively does this
@resolve = Resolve.new
@resolve.content = "foo"
Do you see?
Like Sijo says, you don't need :resolve => @resolve in the form - this
is going to break the form by overriding :resolve in your params,
effectively deleting the parameter from the text field. It would be
better if you sticked to the standard restful scheme and your form
looked like this:
<% form_for @resolve do |f| %>
<p>resolution:<br />
<%= f.text_area 'resolve','content', :cols => 40, :rows => 12 %></p>
<% end %>
This will submit to the ResolveController.create action, which is where
you should create a resolve object/
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---