Q:

Parameters/methods in models in rails

I've added an extra method to my model in rails, let's just say it is:
def subscribed
  true
end

If I create a form with:
<%= f.check_box :subscribed %>

it correctly prints a ticked checkbox, but on submission of the form it says
unknown attribute: subscribed

What am I doing wrong?

A:

Add an attribute accessor like this:
class MyModel
  attr_accessor :subscribed
end

