Getting started w/ Rails 4

Hi, Colin, you see, I think that listing permitted fields all over
again in the controller can be viewed as repetitiveness. Ideally,
model would just accept the bulk of fields coming from the outside,
validate their presence + conformance, and yell if it isn’t the case.
How it is being done now ensures greater flexibility in that
controller can massage + glue up several fields into one etc. before
passing them all to the model. This is good, and I’m not saying this
functionality shouldn’t be available, but in the simplest case,
Post.save(params[:post]) should just do the obvious by adhering to
convention over configuration. Just my opinion.

p.s. I don’t believe I’ve top-posted in this thread? Well, unless you
believe that a few of my quote-less posts, such as this one, are top-
posting. I simply click “reply” under relevant post.

On 6 May 2013 05:53, rihad [email protected] wrote:

Hi, Colin, you see, I think that listing permitted fields all over
again in the controller can be viewed as repetitiveness.

There is no repetition as this is not listing the fields “all over
again”. This is just specifying which fields may (or must) be mass
assigned.

Ideally,
model would just accept the bulk of fields coming from the outside,
validate their presence + conformance, and yell if it isn’t the case.
How it is being done now ensures greater flexibility in that
controller can massage + glue up several fields into one etc. before
passing them all to the model. This is good, and I’m not saying this
functionality shouldn’t be available, but in the simplest case,
Post.save(params[:post]) should just do the obvious by adhering to
convention over configuration. Just my opinion.

It was like that in rails originally I believe, but it is just too
dangerous. It was too easy for the developer to forget to protect the
fields that should not be mass assigned.

p.s. I don’t believe I’ve top-posted in this thread? Well, unless you
believe that a few of my quote-less posts, such as this one, are top-
posting. I simply click “reply” under relevant post.

You are right, I assumed that you had top posted as it was at the top.
Rather you had committed the (arguably) even worse sin of not quoting
the relevant parts of previous message. This means that your latest
message, for example, has no context so one has to look back through
previous emails to find out what it is about.

Colin