Skip to content

Commit

Permalink
Merge remote-tracking branch 'heroku/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjcfs committed May 29, 2016
2 parents f83c0de + 49299c2 commit dfbe00b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app/controllers/admin/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ class Admin::ApplicationController < ApplicationController
before_action :user_must_be_admin

private
def poem_params
params.require(:poem).permit(:title, :text, :johnson, :franklin)
end

def user_must_be_admin
if current_user && !current_user.admin?
redirect_to :root, notice: "You must be an admin"
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/admin/poems_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ def update

respond_with @poem, location: admin_poem_url(@poem)
end

protected
def poem_params
params.require(:poem).permit(:title, :text, :plain_text, :johnson, :franklin)
end
end
1 change: 1 addition & 0 deletions app/views/admin/poems/edit.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ h1 Edit Poem
.form-inputs
= f.input :title
= f.input :text
= f.input :plain_text
= f.input :johnson
= f.input :franklin

Expand Down

0 comments on commit dfbe00b

Please sign in to comment.