I am getting the following in my log file upon loading /login/.
Started GET "/login" for 120.138.93.108 at 2016-01-02 03:06:24 +0000
ActionController::RoutingError (Couldn't find SessionsHelper, expected it to be defined in helpers/sessions_helper.rb):
app/controllers/application_controller.rb:1:in
'
app/controllers/sessions_controller.rb:1:in
'
However, sessions_helper.rb does exist in the helpers folder. Furthermore, application_controller.rb and sessions_controller.rb are defined as Classes and the session_helper.rb as module.
What could be wrong?
I had a similar problem:
Couldn't find AgileTeamsHelper, expected it to be defined in helpers/agile_teams_helper.rb
It turns out I had this defined in my helper:
module AgileTeamHelper
def td_color(text)
if text == "Green"
"green-background"
elsif text == "Yellow"
"yellow-background"
elsif text == "Red"
"red-background"
end
end
end
Instead of:
module AgileTeamsHelper # <-- (Notice the extra s after teams)
def td_color(text)
if text == "Green"
"green-background"
elsif text == "Yellow"
"yellow-background"
elsif text == "Red"
"red-background"
end
end
end
In this case I was missing the 's' in 'AgileTeamsHelper'. I believe that rails looks for a module with the same as the helper, but camel cased. IE. 'agile_teams_helper'.camelize
-> "AgileTeamsHelper"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With