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
On 20 April 2017 at 15:12, nynhex wrote:
> If they’re columns in a table backed by a model, you would simply validate
> them on the model layer.
That is the correct answer to the question asked, but I suspect that
Fugee did not ask the question that he intended to ask.
Colin
If they’re columns in a table backed by a model, you would simply validate them
on the model layer.
> On Apr 20, 2017, at 9:06 AM, fugee ohu wrote:
>
> I'm putting some fields in my form that the controllers gonna use but they're
> columns in the table so I can't validate
I'm putting some fields in my form that the controllers gonna use but
they're not columns in the table so I can't validate at the model level?
How can I validate them?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from
I'm putting some fields in my form that the controllers gonna use but
they're columns in the table so I can't validate at the model level? How
can I validate them?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from
5 matches
Mail list logo