Ruby w/ Sinatra: what is the equivalent of a .js.erb from rails?

前端 未结 3 1461
天命终不由人
天命终不由人 2021-02-06 17:52

.js.erb\'s are nice, because you can use them to replace parts of a page without having to leave the current page, which gives a cleaner and unchopped up feel to the site / app.

3条回答
  •  情话喂你
    2021-02-06 18:29

    Just add .js to the end of the symbol you're passing erb(). A la (to call mypage.js.erb):

    erb "mypage.js".to_sym
    

    Dirty, but it works.

提交回复
热议问题