def resolve_create @resolve = Resolve.new(params[:resolve1])
if @resolve.save
redirect_to :action => ‘list’
else
redirect_to :action => ‘resolve’
end
end
Problem is in parameters arguments…
It should be params[:resolve] …not params[:resolve1]…
def resolve_create @resolve = Resolve.new() @resolve.content = params[:resolve][:content]
if @resolve.save
redirect_to :action => ‘list’
else
render :action => ‘resolve’
end
end
Thanks
seenu
On Thu, Oct 22, 2009 at 2:36 PM, srinivasan sakthivel <
thanks seeenu
the error gone…
but some problem is der with my program.
let me check…
thanks once again… have a gr8 day!
def resolve_create @resolve = Resolve.new(params[:resolve1])
if @resolve.save
redirect_to :action => ‘list’
else
redirect_to :action => ‘resolve’
end
end
Problem is in parameters arguments…
It should be params[:resolve] …not params[:resolve1]…
Thanks
Brijesh S.
no i ahve given resolve1 in view and in controller relove1
so i dont think its the problem with parameters,
now i think i ddn use any active record relations here like one- one or
one -many…
is der any nice link to learn dat easily?
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: