Skip to content

Commit

Permalink
Add path to error page in demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
janpeterka committed Sep 29, 2024
1 parent 57af698 commit 22420c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions demo/app/controllers/examples_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ def self.model_name
ActiveModel::Name.new(self, nil, "Resource")
end
end

# This enpoints serves for testing behavior when error page is encountered
def error
redirect_to "/500.html"
end
end
2 changes: 2 additions & 0 deletions demo/app/views/examples/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
<p>You are being recorded</p>

<%= link_to "Pretend you are doing stuff", { action: :new } %>
<br>
<%= link_to "Try encountering server error", { action: :error } %>
6 changes: 5 additions & 1 deletion demo/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@

root to: "examples#index"

resources :examples, only: [ :index, :show, :new, :create ]
resources :examples, only: [ :index, :show, :new, :create ] do
collection do
get :error
end
end
end

0 comments on commit 22420c5

Please sign in to comment.