Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to understand README #52

Open
amalagaura opened this issue Dec 26, 2011 · 4 comments
Open

How to understand README #52

amalagaura opened this issue Dec 26, 2011 · 4 comments

Comments

@amalagaura
Copy link
Contributor

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

root << widget('comments_widget', 'post-comments', :post => @post)
end
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'

@amalagaura
Copy link
Contributor Author

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.

@apotonick
Copy link
Owner

'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".

@amalagaura
Copy link
Contributor Author

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.

@apotonick
Copy link
Owner

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants