Class: BaseController

Inherits:
ApplicationController
  • Object
show all
Includes:
AuthenticatedSystem, BaseHelper, LocalizedApplication, Pundit
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, #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



62
63
# File 'app/controllers/base_controller.rb', line 62

def advertise
end

#cache_action?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/controllers/base_controller.rb', line 21

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


51
52
53
54
# File 'app/controllers/base_controller.rb', line 51

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

#homepage_featuresObject



56
57
58
59
60
# File 'app/controllers/base_controller.rb', line 56

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

#plaxoObject



29
30
31
# File 'app/controllers/base_controller.rb', line 29

def plaxo
  render :layout => false
end

#rss_site_indexObject



25
26
27
# File 'app/controllers/base_controller.rb', line 25

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

#site_indexObject



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

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