-
-
Save trekdemo/1105176 to your computer and use it in GitHub Desktop.
Revisions
-
trekdemo revised this gist
Jul 25, 2011 . 2 changed files with 14 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ helper_method :grand_parent, :parent, :resource def grand_parent end def parent @parent = params .... end def resource @comment = params[:id] ? parent.comments.find( params[:id] ) : parent.comments.new( params[:comment] ) end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # comments/_form.html.erb <div class="new_comment"> <% form_for [grand_parent, parent, resource ] do |f| %> <%= error_messages @comment %> <p><%= f.label :content, 'Szólj hozzá!' %> <%= f.text_area :content, :class => 'text maxwidth' %></p> -
trekdemo revised this gist
Jul 25, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # comments/_form.html.erb <div class="new_comment"> <% form_for [@project, @message, @comment ] do |f| %> <%= error_messages @comment %> <p><%= f.label :content, 'Szólj hozzá!' %> <%= f.text_area :content, :class => 'text maxwidth' %></p> -
azabaj created this gist
Jul 25, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # comments/_form.html.erb <div class="new_comment"> <%= form_for(@comment, :url => project_message_comments_path(@project,@message)) do |f| %> <%= error_messages @comment %> <p><%= f.label :content, 'Szólj hozzá!' %> <%= f.text_area :content, :class => 'text maxwidth' %></p> <div class="submit_wrapper"> <%= f.submit 'Elküldöm a hozzászólást' %> </div> <% end %> </div> # és ezt a paritalt vagy a messages/show-ból húzzuk be # vagy a statuses/show-ból. és ennek megfelelően kell majd postolni és a kontrollerben pedig redirectelni