How to understand README #52

amalagaura opened this Issue Dec 26, 2011 · 4 comments


None yet

2 participants


I don't understand the README example, but I do understand the screencasts.

root << widget('comments_widget', 'post-comments', :post => @post)
The widget is named post-comments.

You only have comments_widget defined below:

class CommentsWidget < Apotomo::Widget

Where is post-comments? What are the second arguments to widget() I thought they are paramters, like :post ?

Where is this defined in your example on the readme? The only widget you defined was CommentsWidget

= render_widget 'post-comments'


Looking at the rubydoc I got this:
   widget(:comments, 'post-comments', :user => current_user) sets id to 'posts_comments' and #options to the hash.

So when you did the = render_widget 'post-comments' How will that work? That is the id of the div, not the widget name.


'post-comments' is the widget id refering to the actual instance in the tree, which is also used in the div when using #widget_id. There is no "widget name", only the class and the "widget id".


So by default if you do not specify the widget id it uses the class name as the ID ? Can I suggest you don't introduce that in the readme? It doesn't seem necessary for a quick readme style introduction.


Yes, and yes. Sounds good what you say :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment