I have a problem with rendering form for input data. The controller looks like this:
class AdsController < ApplicationController
def new
@ad = current_user.ads.build()
respond_to do |format|
format.html { render :layout => 'new' }# new.html.erb
format.json { render json: @ad }
end
end
end
In the view (the relevant parts):
<%= form_for ([@ad.user, @ad]) do |f| %>
...
<%= f.label 'Description' %></div>
<%= f.text_area :comment, cols:35, rows:4 %>
...
<% end %>
And the model:
class Ad < ActiveRecord::Base
attr_accessible :title, :url, :comment, :category_id, :layout, :user_id
...
end
When I render the form, I get the error:
ActionView::Template::Error (undefined method `comment' for
)
It's weird, because on localhost it's working, but after uploading the app to Heroku I am getting that error.
Where could be a problem?