Refactor step comments code

This commit is contained in:
Luka Murn 2016-11-22 15:01:48 +01:00
parent 0c96036de8
commit e0607f7891
3 changed files with 1 additions and 16 deletions

View file

@ -59,12 +59,6 @@ class StepCommentsController < ApplicationController
)
end
format.html {
flash[:success] = t(
"step_comments.create.success_flash",
step: @step.name)
redirect_to session.delete(:return_to)
}
format.json {
render json: {
html: render_to_string(
@ -79,7 +73,6 @@ class StepCommentsController < ApplicationController
}
else
response.status = 400
format.html { render :new }
format.json {
render json: {
errors: @comment.errors.to_hash(true)

View file

@ -1015,14 +1015,6 @@ en:
success_flash: "Successfully removed user %{user} from task <strong>%{module}</strong>."
error_flash: "User %{user} could not be removed from task <strong>%{module}</strong>."
step_comments:
new:
head_title: "%{project} | %{module} | Add comment to step"
title: "Add comment to step %{step}"
create: "Add comment"
create:
success_flash: "Successfully added comment to step <strong>%{step}</strong>."
users:
enums:
status:

View file

@ -207,7 +207,7 @@ Rails.application.routes.draw do
resources :steps, only: [:edit, :update, :destroy, :show] do
resources :step_comments,
path: '/comments',
only: [:new, :create, :index, :edit, :update, :destroy]
only: [:create, :index, :edit, :update, :destroy]
member do
post 'checklistitem_state'
post 'toggle_step_state'