Sunday, May 16, 2010

Re: [Rails] Problems occur during production, but not in development

On 16 May 2010 08:27, Joe <joe@dev-hq.co.uk> wrote:
> Hi,
>
> Basically I've created a system with categories, that belong to
> tutorials, and these tutorials have positions.
> I've only recently created to new position thing, and I've added this
> to my edit form:
>
>  <p>
>    <%= f.label :position %><br />
>    <%= f.text_field :position %>
>  </p>
>
> This works fine in production mode, and everything is as it should be.

I guess you meant ok in development.

> However when I upload it to my actual site (so it goes to production
> mode) it says an error has occured. And the production log gives out
> this error:
>
> ActionView::TemplateError (undefined method `position' for #<Tutorial:
> 0xb752a384>) on line #21 of app/views/tutorials/edit.html.erb:
> 18:   </p>
> 19:     <p>
> 20:     <%= f.label :position %><br />
> 21:     <%= f.text_field :position %>
> 22:   </p>
> 23:   <p>
> 24:     <%= f.submit 'Update' %>
>
>    app/views/tutorials/edit.html.erb:21
>    app/views/tutorials/edit.html.erb:4

Did you remember to run the migration on the production db so that the
new column is there?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate