Rails inline Javascript and Best Practices

后端 未结 5 2012
你的背包
你的背包 2021-02-14 07:54

I\'m kinda new to using Rails, and an app I am working on is progressing well - however I\'m looking though the generated HTML and noticed things like...



        
5条回答
  •  萌比男神i
    2021-02-14 08:42

    I'd also recommend going with the unobtrusive Javascript approach and use jQuery.

    For a great introductory tutorial on how to do that with Rails take a look at this jQuery + Rails screencast by Ryan Bates.

    If you'd like to keep using helpers with jQuery, then take a look at a jRails, but if you do that, you'll still be violating the unobtrusive Javascript premise.

提交回复
热议问题