Displaying 3 results from an estimated 3 matches for "topic_pag".
Did you mean:
topic_pages
2006 Aug 17
0
super-newb needs help with has_many and other things...
...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
@topic_pages, @topics = paginate :topics, :per_page => 10
end
def show
@topic = Topic.find(params[:id])
end
def new
@topic = Topic.new
end
def create
@topic = Topic.new(params[:topic])
if @topic.save
flash[:notice] = ''Topic was successfully created.''...
2006 Jan 02
6
Paginate with joins messing with id
Hi all,
Best wishes for the new year! :'')
I''m very new to Ruby and Rails, and I ran into a problem with the
"paginate" function. When I use the following method to get a number
of forum topics based on a category name passed via the URI:
@topic_pages, @topics = paginate :topics,
:joins => "INNER JOIN categories ON
topics.category_id = categories.id",
:conditions => ["topics.is_deleted !=
1 AND categories.safe_name = ?", params[:category_name]],...
2006 May 26
0
Paginate include => :last and order by value
...ass_name => ''Reply'', :order => "created_on"
has_one :last_reply, :class_name => ''Reply'', :order => "created_on DESC"
Thought I would be good at this point to paginate like so, where the
created_on value is in the replies table:
@topic_pages, @topics = paginate :topics, :per_page => 10, :include =>
:last_reply, :order => "created_on DESC"
This doesn''t display all 10 topics though, for instance if the hottest
topic has more than 9 replies it will only show that one topic. Seems
that my code is pulling a...