Skip to content
Browse files

adding a 'dashboard' view (logged in home)

  • Loading branch information...
1 parent 633717a commit eeeb7fb9a08e70a1ce293126f1a2c7806e4fc7d0 Julia West committed
Showing with 23 additions and 1 deletion.
  1. +8 −1 app/controllers/pages_controller.rb
  2. +14 −0 app/views/pages/dashboard.html.erb
  3. +1 −0 config/routes.rb
View
9 app/controllers/pages_controller.rb
@@ -4,6 +4,13 @@ def show
end
def home
- render :layout => false
+ logged_in? ?
+ redirect_to( home_path ) : render( :layout => false )
end
+
+ def dashboard
+ return redirect_to :action => :home unless logged_in?
+
+ @theme = "sunset"
+ end
end
View
14 app/views/pages/dashboard.html.erb
@@ -0,0 +1,14 @@
+<div id="picker">
+ <% form_for current_user.moods.build do |f| %>
+ <%= f.hidden_field :red %>
+ <%= f.hidden_field :green %>
+ <%= f.hidden_field :blue %>
+ <%= image_submit_tag 'hexagon.jpg', :id => "hexagon" %>
+ <% end %>
+</div>
+
+<ul>
+ <% current_user.subscribers.each do |subscriber| %>
+ <li><%= link_to subscriber.name, subscriber %></li>
+ <% end %>
+</ul>
View
1 config/routes.rb
@@ -1,5 +1,6 @@
ActionController::Routing::Routes.draw do |map|
map.root :controller => 'pages', :action => 'home'
+ map.home '/dashboard', :controller => 'pages', :action => 'dashboard'
map.resource :session
map.resource :account
map.resource :openid

0 comments on commit eeeb7fb

Please sign in to comment.
Something went wrong with that request. Please try again.