New to haml
Closed this issue · 6 comments
Do you have an example of how display the User that posted the comment in the view?
Hello! There is DummyApp. Try to run it
https://github.com/the-teacher/the_comments/tree/master/spec/dummy_app
If it's not solve your problem - let me know,
Comments tree builds with TheSortableTree gem
TheComments gem has RenderHelper
https://github.com/the-teacher/the_comments/blob/master/app/helpers/render_comments_tree_helper.rb
If you need to build custom comments view, you can copy this helper into your project and change code in it
I'll have to find the time to learn haml :-)
Literally all I want to do is display "comment.user.fname" in the view…do you know how I do that in haml?
On Oct 14, 2013, at 3:05 PM, "Ilya N. Zykin" notifications@github.com wrote:
Comments tree builded with TheSortableTree gem
TheComments gem has RenderHelper
https://github.com/the-teacher/the_comments/blob/master/app/helpers/render_comments_tree_helper.rb
If you need to build custom comments view, you can copy this helper into your project and change code in it
—
Reply to this email directly or view it on GitHub.
Erb
<p class="username"><%= comment.user.fname %></p>
Haml
%p.username= comment.user.fname
Ok, I've got that.
I modified _comment_body.html.haml and I don't see my changes. Even if I just drop in static text…do I need to recompile assets or something?
On Oct 15, 2013, at 1:32 AM, Ilya N. Zykin notifications@github.com wrote:
Erb
<%= comment.user.fname %>
Haml
%p.username= comment.user.fname
—
Reply to this email directly or view it on GitHub.
nice question! No, you should not.
_comment_body.html.haml - it's not view of element of comments tree. It's a part of internal admin views.
TheComments based on TheSortableTree. TheSortableTree used for rendering special render helper. I don't use partials or standart views because it's have problems with perfomance.
TheComments define own RenderHelper for TheSortableTree - it placed here - https://github.com/the-teacher/the_comments/blob/master/app/helpers/render_comments_tree_helper.rb
for customization of your comments tree you should use
bundle exec rails g the_comments:views helper
it's will copy render helper into your project. And change it as you wish.