Permalink
Browse files

fix updates sidebar

  • Loading branch information...
1 parent 6b5d9dd commit 524cef0e28975509fe5f591629bf202811ac068b @sudara sudara committed Mar 22, 2009
Showing with 8 additions and 6 deletions.
  1. +7 −3 app/controllers/updates_controller.rb
  2. +0 −1 app/views/layouts/pages.html.haml
  3. +1 −2 app/views/updates/show.html.erb
@@ -1,8 +1,10 @@
class UpdatesController < ApplicationController
before_filter :login_required, :except => [:index, :show]
+ before_filter :find_recent_updates, :except => [:destroy, :update]
layout 'pages'
+
# GET /updates
# GET /updates.xml
def index
@@ -14,9 +16,7 @@ def index
)
@page_title = "Latest News and Updates"
-
- @recent_updates = Update.find(:all, :limit => 10, :order => 'created_at DESC')
-
+
respond_to do |format|
format.html # index.html.erb
format.xml
@@ -100,6 +100,10 @@ def destroy
protected
+ def find_recent_updates
+ @recent_updates = Update.find(:all, :limit => 10, :order => 'created_at DESC')
+ end
+
def authorized?
logged_in? && admin?
end
@@ -9,7 +9,6 @@
= user_nav_item "How do I?...", {:controller => 'pages', :action => 'howto' }, :title => 'get help with alonetone'
= user_nav_item "Press", {:controller => 'pages', :action => 'press' }, :title => 'press and promotional info'
= user_nav_item "Stats", {:controller => 'pages', :action => 'stats'}, :added_class => 'contact', :title => 'alonetone statistics'
- = user_nav_item "Forums", forums_path, :added_class => 'contact', :title => 'forums'
= user_nav_item "Latest News", updates_path, :added_class => 'contact', :title => 'latest news (blog)'
= yield :pagination
- content_for :static do
@@ -1,2 +1 @@
-<%= render :partial => @update %>
-<%= render :partial => 'latest'%>
+<%= render :partial => @update %>

0 comments on commit 524cef0

Please sign in to comment.