app. If you generate a controller using
rails g controller NAME, a corresponding
using the require directives in
most part this approach works.
Add the gem to your
seed_tray in your application.js file:
page_data_attr to your layout’s
<body> element. This adds data attributes
that allow SeedTray to identify which page is one.
Next, add a few Coffeescript classes. You need to add a class with the same name
as your Rails app. For example, if our app was called
TodoList, we need to
each controller you add a corresponding class. For example, if we had a
TodosController with actions
show, we add to
In each class we add a method named
ready, which defines what we want to run
on that view. SeedTray will call this method automatically when the view is
Never miss another
sales pitch article.
Sign up for our company newsletter. We write short articles about design, products, and being entrepreneurs. We don't write very often, so the risk of spam is pretty small.Sign up for our newsletter