Class: BaseController

Inherits:
ApplicationController
  • Object
show all
Includes:
AuthenticatedSystem, BaseHelper, LocalizedApplication
Defined in:
app/controllers/base_controller.rb

Instance Method Summary collapse

Methods included from BaseHelper

#add_friend_link, #ajax_spinner_for, #avatar_for, #block_to_partial, #box, #city_cloud, #clippings_link, #commentable_url, #container_title, #excerpt_with_jump, #flash_class, #forum_page?, #is_current_user_and_featured?, #jumbotron, #last_active, #more_comments_links, #page_title, #paginating_links, #possesive, #profile_completeness, #render_jumbotron, #render_widgets, #rounded, #search_posts_title, #search_user_posts_path, #show_footer_content?, #tag_auto_complete_field, #time_ago_in_words, #time_ago_in_words_or_date, #tiny_mce_init_if_needed, #tiny_mce_js, #topnav_tab, #truncate_words, #truncate_words_with_highlight, #widget

Methods included from LocalizedApplication

#get_matching_ui_locale, #get_sorted_langs_from_accept_header, #get_valid_lang_from_accept_header, #set_locale

Methods included from AuthenticatedSystem

#login_by_token, #update_last_seen_at

Instance Method Details


60
61
# File 'app/controllers/base_controller.rb', line 60

def advertise
end

#cache_action?Boolean

Returns:

  • (Boolean)

19
20
21
# File 'app/controllers/base_controller.rb', line 19

def cache_action?
  !logged_in? && controller_name.eql?('base') && params[:format].blank?
end

49
50
51
52
# File 'app/controllers/base_controller.rb', line 49

def footer_content
  get_recent_footer_content
  render :partial => 'shared/footer_content' and return
end

#homepage_featuresObject


54
55
56
57
58
# File 'app/controllers/base_controller.rb', line 54

def homepage_features
  @homepage_features = HomepageFeature.find_features
  @homepage_features.shift
  render :partial => 'homepage_feature', :collection => @homepage_features and return
end

#plaxoObject


27
28
29
# File 'app/controllers/base_controller.rb', line 27

def plaxo
  render :layout => false
end

#rss_site_indexObject


23
24
25
# File 'app/controllers/base_controller.rb', line 23

def rss_site_index
  redirect_to :controller => 'base', :action => 'site_index', :format => 'rss'
end

#site_indexObject


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'app/controllers/base_controller.rb', line 31

def site_index
  @posts = Post.find_recent

  @rss_title = "#{configatron.community_name} "+:recent_posts.l
  @rss_url = rss_url
  respond_to do |format|
    format.html { get_additional_homepage_data }
    format.rss do
      render_rss_feed_for(@posts, { :feed => {:title => "#{configatron.community_name} "+:recent_posts.l, :link => recent_url},
                            :item => {:title => :title,
                                      :link =>  Proc.new {|post| user_post_url(post.user, post)},
                                       :description => :post,
                                       :pub_date => :published_at}
        })
    end
  end
end