Class: Wf::FormsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Wf::FormsController
- Defined in:
- app/controllers/wf/forms_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/wf/forms_controller.rb', line 43 def create @form = Wf::Form.new(form_params) if @form.save redirect_to forms_path, notice: "form was successfully created." else render :new end end |
#destroy ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'app/controllers/wf/forms_controller.rb', line 25 def destroy @form = Wf::Form.find(params[:id]) @form.destroy respond_to do |format| format.html { redirect_to forms_path, notice: "form was successfully deleted." } format.js { render js: "window.location.reload();" } end end |
#edit ⇒ Object
17 18 19 |
# File 'app/controllers/wf/forms_controller.rb', line 17 def edit @form = Wf::Form.find(params[:id]) end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/wf/forms_controller.rb', line 9 def index @forms = Wf::Form.order("id DESC").page(params[:page]) end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/wf/forms_controller.rb', line 13 def new @form = Wf::Form.new end |