From ac583b73519cbceec6d3c1aa063125a628da2406 Mon Sep 17 00:00:00 2001 From: Logan Fick Date: Fri, 10 Nov 2017 14:31:29 -0500 Subject: Changed messages shown by info pages. --- app/controllers/info_controller.rb | 16 ++++++++-------- app/views/info/edit.html.erb | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/controllers/info_controller.rb b/app/controllers/info_controller.rb index 7c1b631..7834d2a 100644 --- a/app/controllers/info_controller.rb +++ b/app/controllers/info_controller.rb @@ -22,9 +22,9 @@ class InfoController < ApplicationController def create @info = Info.new(info_params) if @info.save - redirect_to @info, notice: 'Info has been created.' + redirect_to @info, notice: 'The info page has been created!' else - flash[:alert] = "Error creating info" + flash[:alert] = "An error occured while creating the info page." render action: "new" end end @@ -32,18 +32,18 @@ class InfoController < ApplicationController def update @info.attributes = info_params() if @info.save - redirect_to @info, notice: 'Info has been updated.' + redirect_to @info, notice: 'The info page has been updated!' else - flash[:alert] = "There was a problem while updating the info" + flash[:alert] = "An error occured while updating the info page." render action: "edit" end end def destroy if @info.destroy - flash[:notice] = "Info deleted!" + flash[:notice] = "The info page has been deleted!" else - flash[:alert] = "There was a problem while deleting this info" + flash[:alert] = "An error occured while deleting the info page." end redirect_to info_index_path end @@ -63,8 +63,8 @@ class InfoController < ApplicationController def auth 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 end end -end \ No newline at end of file +end diff --git a/app/views/info/edit.html.erb b/app/views/info/edit.html.erb index 0135219..0f90c74 100644 --- a/app/views/info/edit.html.erb +++ b/app/views/info/edit.html.erb @@ -6,5 +6,5 @@ <%= render partial: "md_editor", locals: {name: "info[content]", content: @info.content} %>

<%= f.submit "Update Info", class: "btn blue left" %>

<% end %> -

<%= button_to "Delete Info", @info, method: "delete", data: {confirm: "Delete Info forever?"}, class: "btn red right" %>

-
\ No newline at end of file +

<%= button_to "Delete Info", @info, method: "delete", data: {confirm: "Are you sure you want to delete this info page?"}, class: "btn red right" %>

+
-- cgit v1.2.3