Pagination and Controller setup Below is some code that I've been working to simplify, however I feel there is more that can be done. Please note that I did clean up the articles.search method.

class HomeController &lt; ApplicationController
    @@articles_per_page = 6
     def index
        @paged_articles = articles.search(:user_id=&gt; @@user_id, :page=&gt;'1', :per_page=&gt;@@articles_per_page)
        @tags = get_tags
        @next_page_url = url_for(:controller =&gt;:home, :action =&gt; :page, :page_id=&gt;  2)
        @page_title = "Recent articles"
     end

    def tags
      @paged_articles = articles.search(:page=&gt;'1',:tags=&gt;params[:tag_name], :per_page=&gt;@@articles_per_page)
       @tags = get_tags
       @next_page_url = url_for(:controller =&gt;:home, :action =&gt; :page, :tag_name =&gt; params[:tag_name], :page_id=&gt;  2)
       @page_title = "Search articles by tags"
       render :index
     end

    def about
       @page_title = "About"
    end    

   private
    def get_tags
         articles.getTags 'param1', 'param2'
    end
   end


I simplified it this way

class HomeController &lt; ApplicationController
  @@articles_per_page = 6
  @@first_page_articles_options = {:page=&gt;'1', :per_page=&gt;@@articles_per_page}
  @@second_page_url_options = {:controller =&gt;:home, :action =&gt; :page, :page_id=&gt;  2}


  def index
    @paged_articles = articles.search(@@first_page_articles_options)
    @tags = get_tags
    @next_page_url = url_for(@@second_page_url_options)
    @page_title = "Recent articles"
  end

  def tags
    @@first_page_articles_options[:tags]  = params[:tag_name]
    @paged_articles = articles.search(@@first_page_articles_options)
    @tags = get_tags

    @@second_page_url_options[:tag_name]  = params[:tag_name]
    @next_page_url = url_for(@@second_page_url_options)
    @page_title = "Search articles by tags"
    render :index
  end
   def about
      @page_title = "About"
  end

  private
  def get_tags
         articles.getTags 'param1', 'param2'
  end
end


So what do you think? Is there any way to make it more better and cleaner?
You can move urls and titles to helpers and articles search to separate method

class HomeController &lt; ApplicationController
  # this methods can be used in view template
  helper_method :next_page_url, :page_title

  @@articles_per_page = 6
  @@first_page_articles_options = {:page=&gt;'1', :per_page=&gt;@@articles_per_page}
  @@second_page_url_options = {:controller =&gt;:home, :action =&gt; :page, :page_id=&gt;  2}


  def index
    @paged_articles = articles.search(@@first_page_articles_options)
    @tags = get_tags
  end

  def tags
    @paged_articles = load_articles
    @tags = get_tags

    render :index
  end
   def about
      @page_title = "About"
  end

  private

    def load_articles
      ...
    end 

  ...

  # helpers

  def next_page_url
    if filter_by_tags?
      url_for(@@second_page_url_options)  
    else
      @@second_page_url_options[:tag_name] = params[:tag_name]
      url_for(@@second_page_url_options)
    end    
  end

  def page_title
    if filter_by_tags?
      "Recent articles" 
    else
      "Search articles by tags"
    end  
  end

  def filter_by_tags?
    params[:tag_name].present?
  end
end