Ruby on Rails Thursday, April 20, 2017

You can still add unpersistent attributes to your model and validate them like any other attribute on schema.

You should treat these params like any other param at controller and permit them.

Add this to your model

attr_accessor :some_attribute

So then you can do MyModel.new(some_attribute: 'foo')




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0532be8f-74e3-4597-8327-9d56eeb32d85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment