Event related controllers and views #1

Merged
ignisf merged 10 commits from event-related-controllers-and-views into master 2014-08-31 11:33:09 +03:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit 90c3361f88 - Show all commits

View File

@ -1,6 +1,6 @@
class LecturesController < ApplicationController
before_filter :authenticate_user!
before_action :assign_lecture, only: [:show]
before_action :assign_lecture, only: [:show, :edit, :update]
def new
@lecture = Lecture.new
@ -20,6 +20,11 @@ class LecturesController < ApplicationController
end
def update
if @lecture.update lecture_params
redirect_to @lecture
else
render :edit, status: :unprocessable_entity
end
end
def show

View File

@ -1,2 +1,2 @@
h1 Lectures#edit
p Find me in app/views/lectures/edit.html.slim
h1.entry-title Редакция на лекция
= render 'form'