gazay / gon

Your Rails variables in your JS
MIT License
3.05k stars 184 forks source link

Default RABL/Jbuilder template path #20

Closed ryanb closed 12 years ago

ryanb commented 12 years ago

It would be nice if the rabl/jbuilder template could automatically use the same template as the controller action. This seems like a good behavior to preload some records into JavaScript which can then later be fetched by the same action.

def index
  @products = Product.all
  gon.rabl as: "products"
  # would load "index.json.rabl"
end
gazay commented 12 years ago

Done in 2.2.0. Thank you for idea, usage with rabl and jbuilder looks better now)

nesquena commented 12 years ago

Nice work! Great addition

gazay commented 12 years ago

Thank you! It's great when there is some great responses about work, which can improve this work)