Rails inline Javascript and Best Practices

后端 未结 5 2103
名媛妹妹
名媛妹妹 2021-02-14 08:02

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条回答
  •  南旧
    南旧 (楼主)
    2021-02-14 08:38

    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.

提交回复
热议问题