Questions tagged [actioncontroller]

ActionController is the main controller class in Ruby on Rails.

ActionController is the main controller class in Ruby on Rails.

424 questions
-1
votes
2 answers

Strange error with belongs_to association between Comment and User

I have three models: A User model, a Post model, and a Comment model. A user can create a post, and then inside a post's show page, there is a list of comments with a form to post a comment. A comment is posted and displayed on the post's show page.…
-1
votes
1 answer

Rails Server Not Returning Response

I am doing Rails 2.3 to 3.2 upgrade. During this, I have changed lots of things. Now I don't see any HTML in response while opening homepage of the web app. I have verified using after_filter that my controllers do return HTML but Rails does not…
mohit
  • 1,087
  • 1
  • 9
  • 18
-1
votes
2 answers

How do I set a custom ETag value in a Rails controller response?

For one controller (only), I'd like to use an ETag value generated outside of rails caching logic, and manage 304-vs-200 responses myself. It seems that nothing I do to set the ETag header works: response.etag = myEtag headers['ETag'] =…
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
-2
votes
2 answers

Ruby on rails: undefined method `[]' for nil:NilClass?

when i try to create it says undefined method. def create @stock = Stock.find(params[:stock_availabilities][:stock_id]) @stock_availability = StockAvailability.new(stock_availabilities_params) respond_to do |format| if…
1 2 3
28
29