gaurav bagga wrote:
What I mean is, is there a way by which params[:user][:email]
gets assigned to
Depends on what you want to do with the params hash. There are a few
commonly used ActiveRecord::Base class methods that take an attributes
hash as an argument, so you can do:
user = User.create(params[:user])
user = User.new(params[:user])
(I think that’s all of them.) See the ActiveRecord::Base documentation
at http://api.rubyonrails.com/classes/ActiveRecord/Base.html for more
details on these methods.
Outside of those, I don’t think there’s any way to assign the params to
a model object “automatically”, though.