small fixes
This commit is contained in:
parent
2a0a0a6241
commit
262a78f602
|
@ -2,7 +2,7 @@
|
|||
class Admin::AskAdminsController < OrbitAdminController
|
||||
def initialize
|
||||
super
|
||||
@app_title = 'ask_admin'
|
||||
@app_title = 'ask'
|
||||
end
|
||||
|
||||
def index
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
class Admin::AsksController < OrbitAdminController
|
||||
include Admin::AsksHelper
|
||||
before_action ->(module_app = @app_title) { set_variables module_app }
|
||||
before_action :set_askquestion, only: [:edit, :destroy]
|
||||
before_action :set_askquestion, only: [:edit, :destroy, :update]
|
||||
|
||||
def initialize
|
||||
super
|
||||
|
@ -65,17 +65,15 @@ class Admin::AsksController < OrbitAdminController
|
|||
end
|
||||
|
||||
def edit
|
||||
@ask_question = AskQuestion.find(params[:id])
|
||||
@url = admin_ask_path(@ask_question)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@askquestions.destroy
|
||||
@ask_question.destroy
|
||||
redirect_to "/admin/asks"
|
||||
end
|
||||
|
||||
def update
|
||||
@ask_question = AskQuestion.find(params[:id])
|
||||
@ask_question.update_attributes(params.require(:ask_question).permit!)
|
||||
if @ask_question.send_email?
|
||||
build_email(@ask_question)
|
||||
|
@ -149,6 +147,6 @@ class Admin::AsksController < OrbitAdminController
|
|||
end
|
||||
|
||||
def set_askquestion
|
||||
@askquestions = AskQuestion.find(params[:id])
|
||||
@ask_question = AskQuestion.find(params[:id])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue