On Feb 9, 2012, at 11:06 AM, Christopher Jones wrote:
> By stating params in the model as
>
> def set_wishlist(params)
>
> It returns the error of: wrong number of arguments (0 of 1).
>
> If I was to try and call the create method from wishlistController
> through the user model, how would I go about calling it?
>
> I have not had he experience of doing such thing before.
I don't think you can, but you can do an after_filter on create, in the
controller:
after_filter :foo, :only => :create
...
private
def foo
@word.update_attributes(:notes => 'FOO!')
end
I just did this and it worked. You would have access to the variables you set
in your create method. Apparently these after_filter beasties fire before any
redirect is called.
Walter
>
> Thanks
> Chris.
>
> --
> 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.
>
--
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.