3

I'm new to Padrino and have been running through the sample blog tutorial. I'm getting a NoMethodError when using the sample code below

# app/views/posts/index.haml
@title = "Welcome"

#posts= partial 'posts/post', :collection => @posts

I tried some form helpers and they also gave the same error. The 'render' method works though. I'm using Padrino 0.9.23.

Are the Padrino helpers included automatically or do I have to?

  • I undeleted this post since it has been shown to be useful; someone else [solved a problem with Google's cached copy of this question](http://news.ycombinator.com/item?id=2383713). You can delete it again if you wish, but it would be nice to leave it up for the benefit of others. – Michael Myers Mar 29 '11 at 23:02

2 Answers2

2

Ok I did have to include the helpers for my app, I add the following line to the app/app.rb file just after the class definition.

# app/app.rb
class SampleBlog < Padrino::Application  
  register Padrino::Helpers

I found this out by looking at the admin/app.rb

0

Yes thats correct but if you use padrino app generators, then register Padrino::Helpers is automatically added in app.rb of that app.

Jai Madhav
  • 603
  • 8
  • 17