Displaying 2 results from an estimated 2 matches for "safe_nam".
Did you mean:
safe_name
2006 Apr 12
4
Using join in a link_to
I''ve got this:
<% for tag in @tags -%>
<%= link_to tag.name, :controller => ''archives'', :action => ''tags'', :id
=> tag.safe_name %>
<% end -%>
I want to use the .join(", ") trick to stick a comma between the links,
where should I do this?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 02
6
Paginate with joins messing with id
...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]],
:order_by => "topics.is_sticky DESC,
topics.id DESC",
:per_page => 20
Then, on my topics listing page I try this:
for topic in @topics
link_to h(topic.title), :action => ...