ruby - Why is rails not picking up a function defined in .js.erb? -


The rail is not identifying my .js.erb file and just ignoring anything in it.

The relevant snippet advanced_search.html. ARB

  & lt;% = "advanced_search_orders_form"%> in the render   

I have another file _advanced_search_orders_form.html. ARB, which is displayed properly with a small problem.

_advanced_search_orders_form.html .erb

  & lt; Form id = "advancedSearchOrder" name = "advanced searchform" value = "advanced search" action = "" class = "search-line" method = "receive" onsubmit = "valid valid advanced searchform ()" & Gt; This valid Advanced Search () is defined in  _advanced_search_orders_form.js.erb , but the rail works such as functions are not defined. Apart from this, if I just write a warning ("check") in _advanced_search_orders_form.js.erb, then it does not render. Even the editor (Ruby Manny) says that it did not validate the definition of this function Advanced Searchform.  

I have not worked with all .jserb files, so I'm sure I'm doing something wrong. Did I incorrectly define the file name, or do I have to include it etc.? Actually appreciate some help here.

Validandsoftform () should be placed in .js file. Js.coffee, if you use a coffee script in your property / javascript folder, you can use it from your pages

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -