0

I'm following this question: Rails with backbone-rails: asset helpers (image_path) in EJS files.

I have my .jst.ejs.erb files in app/assets/javascripts/templates.

My code in a template looks like:

<li><%= link_to "Sign In", new_user_session_path %> </li>

But I'm getting the error:

undefined local variable or method `new_user_session'

even though my rake routes command shows there is definitely a route there.

I have a ejs.rb initalizer that looks like:

EJS.evaluation_pattern    = /\{\{([\s\S]+?)\}\}/
EJS.interpolation_pattern = /\{\{=([\s\S]+?)\}\}/

If I try what the second answer suggests, there aren't any errors on the page, but it shows "False" where the link should go.

Community
  • 1
  • 1
the_
  • 1,183
  • 2
  • 30
  • 61

1 Answers1

1

i guess this will work

<li><%= link_to "Sign In", new_user_session_path %> </li>
Paritosh Piplewar
  • 7,982
  • 5
  • 26
  • 41
  • Oops, forgot to change that back when I was trying to fix the problem. But it still doesn't fix it? – the_ Apr 27 '14 at 03:37