Skip to content

Instantly share code, notes, and snippets.

@telagraphic
Created September 16, 2012 14:21
Show Gist options
  • Save telagraphic/3732608 to your computer and use it in GitHub Desktop.
Save telagraphic/3732608 to your computer and use it in GitHub Desktop.
devise session not applying to each user...
<!DOCTYPE html>
<html>
<head>
<title>Life</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<% flash.each do |key, value| %>
<%= content_tag(:div, value, class: "alert alert-#{key}") %>
<% end %>
<% if user_signed_in? %>
<%= link_to "Sign Out", destroy_user_session_path, :method => :delete %>
<%= current_user.email %>
<% end %>
<%= yield %>
<%= debug(params) if Rails.env.development? %>
</body>
</html>
class DaysController < ApplicationController
before_filter :authenticate_user!
def get_day
@day = Day.find(params[:id])
end
def index
@days = Day.all
end
......
end
Life::Application.routes.draw do
devise_for :users do
resources :days
end
root :to => "Days#index"
resources :days do
resources :habits
end
resources :days do
resources :feeds
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment