I have stuff with Ruby on Rails 3
I try this simple code
def index
flash[:notice] = "ok"
respond_to do |format|
format.html # index.html.erb
end
end
it does not work
NoMethodError in DashboardsController#index
undefined method `flash' for #<ActionDispatch::Request:0x7fee9329a9d0>
When I try
redirect_to :some_in, :notice => "ok"
in other place (in some_controller.rb) and then print this :notice in .erb I have same error, undefined method `flash'
I'm stuck on this. I used google to search for it but it does not help.
ApplicationController
which is inheriting fromActionController::Base
? For example, does your controller look like:class DashboardsController < ApplicationController
at the top? – Chalcanthiterails-api
gem by chance? – Barails-api
, see here – Armor