I set up the rails server, and tried to load the app on localhost:3000
However, I end up with:
ArgumentError in HomeController#index
Need a handler. Supply an options hash that has a :with key as the last
argument.
Copy and paste the full error here along with the section of code
causing the problem (presumably the index method in this case) and
tell us which line the error refers to. First however look carefully
at the error message and the line of code and try to work out what the
problem is. The clue is usually in the message though it can
sometimes take a bit of digging out.
I set up the rails server, and tried to load the app on localhost:3000
However, I end up with:
ArgumentError in HomeController#index
Need a handler. Supply an options hash that has a :with key as the last
argument.
I’m not sure what to do here, any help or pointing me in the right
direction is greatly appreciated.
I just got this error as well, and it can be fixed by removing
“protect_from_forgery” in /app/controllers/application_controller. I’m
very new to ROR so I’m not sure what the implications will be for doing
this though…
Okay, better yet, just place the 2 on separate lines. So in your
application_controller it should look like:
…
protect_from_forgery
rescue_from CanCan::AccessDenied do |exception|
…
Thankyou for this!!!
I don’t know what’s going on here, but I’ve been fighting with this for
the past 4 hours. If you have any other tips on things like this that
got you hung up I’m all ears as new to ruby as well.