search for: article_pages

Displaying 7 results from an estimated 7 matches for "article_pages".

2006 Apr 27
5
def list - paginate question
How do I adapt this code to only list articles made by the user logged into the session? def list @article_pages, @article = paginate :articles, :per_page => 10 end -- Posted via http://www.ruby-forum.com/.
2007 Jun 19
1
Display Options While Paginating
I have a table full of articles that I want to paginate. Easy enough with: [Controller] @article_pages, @articles = paginate(:articles, :per_page => 20, :order => ''post_date DESC, title ASC'') BUT, there are different types of articles: regular news articles (designated NA), and press releases (designated PR). If I want to put each type in a different table on the same page,...
2006 Feb 21
6
Select articles from group with id ''1'' and id ''2''
I have to tables: "articles" and "groups". Between I have article_groups as a jointable. Now I want to select every article who is a member of group with id ''1'' and id ''2''. Whats best way to get that? Extract from schemas: CREATE TABLE articles ( id int auto_increment, ingress text NOT NULL, story_text longtext, constraint fk_items_users
2012 Feb 17
0
HtmlSlicer 0.0.1
How to split HTML content? Well, the text like: <p>Ruby&nbsp;on&nbsp;Rails is a next-generation web-framework<br><b>YEAH!</b>And of course Java killer?! :) &copy;</p> You can split to a pages in a smart way. I tried to realize it in a gem for my internal use, and now when it works for my Rails 3.1.3 application, this is enough to make it public. I
2006 Dec 11
0
auth_generator 2.0.1 undefined method `login_required' for ... ArticlesController
...def index list render :action => ''list'' end # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) verify :method => :post, :only => [ :destroy, :create, :update ], :redirect_to => { :action => :list } def list @article_pages, @articles = paginate :articles, :per_page => 10 end def show @article = Article.find(params[:id]) end def new login_required ''editors'' @article = Article.new end def create login_required ''editors'' @article = Article.new(par...
2006 Jan 02
3
Selecting conditionally from HABTM
Hello, I was wondering whether there is a nice Rubyesque way of selecting from a pair of HABTM models where one of them is inherited from another object. Here is the situation: I have a ''posts'' table from which ''replies'' and ''articles'' are inherited. Articles have_and_belong_to_many categories, but neither posts nor replies do (it just does
2006 Mar 12
11
HABTM selection conditions
Hi, I am currently trying to learn RoR and there is something I cannot figure out. I have two models: Article and Category, that are HABTM-linked. Everything works fine if I want to select all articles corresponding to a category, with something like @articles = @category.find(@params[:id]).articles However, I have a ''published'' field in my ''articles''