Changed messages shown by info pages.
This commit is contained in:
@@ -22,9 +22,9 @@ class InfoController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
@info = Info.new(info_params)
|
@info = Info.new(info_params)
|
||||||
if @info.save
|
if @info.save
|
||||||
redirect_to @info, notice: 'Info has been created.'
|
redirect_to @info, notice: 'The info page has been created!'
|
||||||
else
|
else
|
||||||
flash[:alert] = "Error creating info"
|
flash[:alert] = "An error occured while creating the info page."
|
||||||
render action: "new"
|
render action: "new"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -32,18 +32,18 @@ class InfoController < ApplicationController
|
|||||||
def update
|
def update
|
||||||
@info.attributes = info_params()
|
@info.attributes = info_params()
|
||||||
if @info.save
|
if @info.save
|
||||||
redirect_to @info, notice: 'Info has been updated.'
|
redirect_to @info, notice: 'The info page has been updated!'
|
||||||
else
|
else
|
||||||
flash[:alert] = "There was a problem while updating the info"
|
flash[:alert] = "An error occured while updating the info page."
|
||||||
render action: "edit"
|
render action: "edit"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
if @info.destroy
|
if @info.destroy
|
||||||
flash[:notice] = "Info deleted!"
|
flash[:notice] = "The info page has been deleted!"
|
||||||
else
|
else
|
||||||
flash[:alert] = "There was a problem while deleting this info"
|
flash[:alert] = "An error occured while deleting the info page."
|
||||||
end
|
end
|
||||||
redirect_to info_index_path
|
redirect_to info_index_path
|
||||||
end
|
end
|
||||||
@@ -63,8 +63,8 @@ class InfoController < ApplicationController
|
|||||||
|
|
||||||
def auth
|
def auth
|
||||||
unless mod?
|
unless mod?
|
||||||
flash[:alert] = "You are not allowed to edit info!"
|
flash[:alert] = "You are not allowed to edit info pages!"
|
||||||
redirect_to @info ? @info : info_index_path
|
redirect_to @info ? @info : info_index_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
<%= render partial: "md_editor", locals: {name: "info[content]", content: @info.content} %>
|
<%= render partial: "md_editor", locals: {name: "info[content]", content: @info.content} %>
|
||||||
<p><%= f.submit "Update Info", class: "btn blue left" %></p>
|
<p><%= f.submit "Update Info", class: "btn blue left" %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p><%= button_to "Delete Info", @info, method: "delete", data: {confirm: "Delete Info forever?"}, class: "btn red right" %></p>
|
<p><%= button_to "Delete Info", @info, method: "delete", data: {confirm: "Are you sure you want to delete this info page?"}, class: "btn red right" %></p>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user