ruby on rails - Can't use link path -


Hello I'm a new one in Ruby on Rails. I have encountered strange behavior

I add a link

 

and get it

  undefined local variable or method `diary_add_record_path ' 

But when I use a different route Use (main diary) it works fine Someone can tell me what is wrong with it.

has two options

i) Add a custom root name and use it

  get 'diary / add_record', for: 'add diary' ,: as = & gt; Add_diary  

gets your link

  
link = 'Добавить запись', add_diary_path ,: remote = & gt; Truth: 'Data-Type' = & gt; 'Html' ,: id = & gt; 'New record-link'% & gt;

ii) Rake the rake and locate the root rail generated for your path

  the rake roots | Grep 'add_record'  

and use it in your link


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

c# - Create dynamic LINQ query expression at runtime which translates into a parameterized SQL query for nullable types -

cmake - cpack generates RPMs with %files entries that conflict with the RPM spec. How to fix? -