Follow Along as I Stumble on the Path to Learning RoR

Posts tagged “route

Sign Out Wasn’t Working with Devise for Me

Devise’s Sign Out wasn’t working for me. I’ve seen other solutions, but they didn’t worked for me. However, I found an answer that worked for me on Devise’s wiki.

Previously, I used this link:

<%= link_to "Logout", destroy_user_session_path, method: :delete %>

However, that wasn’t working, so I changed (in config/initializers/devise.rb in ):

config.sign_out_via = :delete

to:

config.sign_out_via = :get

and revised the link to (removed “method: :delete”):

<%= link_to "Logout", destroy_user_session_path %>

Subdomains

here are some tutorials on making subdomains work in Rails 3.0

http://railscasts.com/episodes/221-subdomains-in-rails-3

 

http://bcardarella.com/post/716951242/custom-subdomains-in-rails-3

 

if you want to test this locally, you need to edit your hosts file:

 

for windows users: http://www.ehow.com/how_5225562_edit-windows-hosts-file.html


404 Errors

Sometimes you need to route people to 404 errors.

Here’s how to create a method to do this:

http://stackoverflow.com/questions/2385799/how-to-redirect-to-a-404-in-rails