#verify :method => :post, :only => [ :create, :...... ], :redirect_to => { :action => :index }
def index
- end
-
- def list
reviews = Review.find :all, :conditions => ['rule_failure_id=?', params[:rule_failure_id]]
- render :partial => "list", :locals => { :reviews => reviews }
+ render :partial => "index", :locals => { :reviews => reviews }
end
def form
render :partial => "form"
end
- def formComment
+ def form_comment
@review_comment = ReviewComment.new
@review_comment.user = current_user
@review_comment.review_id = params[:review_id]
review_comment.save
params[:rule_failure_id] = review.rule_failure_id
- list
+ index
end
- def createComment
+ def create_comment
#return access_denied unless has_role?(:user, @project)
review_comment = ReviewComment.new(params[:review_comment])
review_comment.user = current_user
review_comment.save
- list
+ index
end
end
<% end %>
<div id="reviewFailure<%= violation.id -%>" style="padding:5px; background:white; display:<%= displayReviewFailureDiv -%>">
- <%= render :partial => "reviews/list", :locals => { :reviews => violation.reviews } %>
+ <%= render :partial => "reviews/index", :locals => { :reviews => violation.reviews } %>
</div>
</td>
<%= f.text_area :review_text, :rows => 10, :id => "commentText" + @review_comment.review_id.to_s %>
<br/>
<%= submit_to_remote 'create_btn', 'Add comment',
- :url => { :action => 'createComment', :rule_failure_id => @rule_failure_id },
+ :url => { :action => 'create_comment', :rule_failure_id => @rule_failure_id },
:update => { :success => "reviewFailure" + @rule_failure_id.to_s, :failure => "fail" } %>
<%= submit_to_remote 'cancel_btn', 'Cancel',
:url => { :action => 'list', :rule_failure_id => @rule_failure_id.to_s },
--- /dev/null
+<%
+ unless reviews.blank?
+ reviews.each do |review|
+%>
+
+ <%= render :partial => "reviews/view", :locals => { :review => review } %>
+
+<%
+ end
+ end
+%>
\ No newline at end of file
+++ /dev/null
-<%
- unless reviews.blank?
- reviews.each do |review|
-%>
-
- <%= render :partial => "reviews/view", :locals => { :review => review } %>
-
-<%
- end
- end
-%>
\ No newline at end of file
</div>
<%= link_to_remote "Add a comment",
- :url => { :controller => "reviews", :action => "formComment", :review_id => review.id, :rule_failure_id => review.rule_failure_id },
+ :url => { :controller => "reviews", :action => "form_comment", :review_id => review.id, :rule_failure_id => review.rule_failure_id },
:update => "createComment" + review.id.to_s,
:complete => "$('commentText" + review.id.to_s + "').focus()" -%>
+++ /dev/null
-Created!
\ No newline at end of file
+++ /dev/null
-Hello !
\ No newline at end of file