Skip to content

Commit

Permalink
Added no_contributor_info route to show flash notice thank you
Browse files Browse the repository at this point in the history
To give thank you for contributor who did not leave their info.
  • Loading branch information
hisayohorie committed Aug 2, 2017
1 parent b1438a8 commit 8a04ea2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/controllers/contributors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ def create
end
end

def no_contributor_info
flash[:notice] = "Thank you"
redirect_to root_url
end

private

def contributor_params
Expand Down
2 changes: 1 addition & 1 deletion app/views/contributors/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
= f.text_field :email
%p.button
= f.submit "Submit"
= link_to "I prefer not to", root_url
= link_to "I prefer not to", contributors_no_info_path
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def matches?(request)
post "/authorities/:authority_id/councillor_contributions/new", to: "councillor_contributions#new"

resources :contributors, only:[:new, :create]
get "/contributors/no_info", to: "contributors#no_contributor_info"

namespace :atdis do
get :test
Expand Down

0 comments on commit 8a04ea2

Please sign in to comment.