Lecture editing
This commit is contained in:
parent
6728b3d059
commit
90c3361f88
|
@ -1,6 +1,6 @@
|
||||||
class LecturesController < ApplicationController
|
class LecturesController < ApplicationController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_action :assign_lecture, only: [:show]
|
before_action :assign_lecture, only: [:show, :edit, :update]
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@lecture = Lecture.new
|
@lecture = Lecture.new
|
||||||
|
@ -20,6 +20,11 @@ class LecturesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
if @lecture.update lecture_params
|
||||||
|
redirect_to @lecture
|
||||||
|
else
|
||||||
|
render :edit, status: :unprocessable_entity
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
h1 Lectures#edit
|
h1.entry-title Редакция на лекция
|
||||||
p Find me in app/views/lectures/edit.html.slim
|
= render 'form'
|
||||||
|
|
Loading…
Reference in New Issue