Permalink
Browse files

adding changes in user interfaces, in comments views

  • Loading branch information...
1 parent c6339ff commit e4b43519c8dfad2c46caf34cd896b3fe6c288008 Carlos Sanchez Perales committed Sep 9, 2009
View
3 app/controllers/comments_controller.rb
@@ -33,7 +33,6 @@ def edit
@comment = Comment.find(params[:id])
@comment.body = nil
@comment.subject = 'Re: ' + @comment.subject
-
respond_to do |format|
format.js { render 'edit', :layout => false }
end
@@ -51,7 +50,7 @@ def update
def show
@comment=Comment.find(params[:id])
respond_to do |format|
- format.js { render 'show.rjs' }
+ format.js { render 'show', :layout => false }
end
end
View
1 app/views/comments/#show.html.erb#
@@ -0,0 +1 @@
+
View
2 app/views/comments/_child.html.haml
@@ -0,0 +1,2 @@
+.link_comment_child{:id => "child_#{child.dom_id}"}
+ = link_to_remote "#{child.subject}", :url => comment_path, :update =>{:success => "child_#{child.dom_id}"}, :method => :get
View
1 app/views/comments/_childs.html.haml
@@ -0,0 +1 @@
+= childs.class.name
View
4 app/views/comments/_comment.html.haml
@@ -13,5 +13,5 @@
.comment_form{:id => "comment_form_#{comment.dom_id}"}
- .childs{:id =>"child_#{comment.dom_id}"}
- = render :partial => 'comments/comment', :collection => comment.children
+ .childs{:id =>"childs_#{comment.dom_id}"}
+ = render :partial => 'comments/child', :collection => comment.children
View
1 app/views/comments/_comment_child.html.haml
@@ -0,0 +1 @@
+= comment.subject
View
1 app/views/comments/show.html.erb
@@ -1 +0,0 @@
-<%= "Estas en show" %>
View
1 app/views/comments/show.html.haml
@@ -0,0 +1 @@
+= render :partial => 'comment', :object => @comment
View
1 app/views/comments/show.rjs
@@ -1 +0,0 @@
-page.replace_html "#{@comment.dom_id}", :partial => 'comment', :object => @comment
View
2 app/views/comments/update.rjs
@@ -1,2 +1,2 @@
page.replace_html "comment_form_#{@comment.dom_id}", ''
-page.replace_html @comment.dom_id, :partial => 'comments/comment', :object => @comment
+page.replace_html "childs_#{@comment.dom_id}", :partial => 'comments/child', :collection => @comment.children

0 comments on commit e4b4351

Please sign in to comment.