aperture science wrote in post #961979: > On Nov 16, 3:27pm, Marnen Laibow-Koser <[email protected]> wrote: > >> Where was it before (when it wasn't working)? > > It had been defined within the tag_cloud definition, which I had > assumed would be processing the loop based on "tag_cloud(@tags, > %w(css1 css2 css3 css4))"
No, I mean where did you *set* @tags, not where did you read it? > > > I have since found it necessary to define @tags =... in every action > for each controller in which the tag cloud appears That's pretty standard Rails. You can use a before_filter to remove the duplication. > > Furthermore, in order for the tags to actually function when clicked, > it was necessary to add: > def tag > @tags = Blog.tag_counts_on(:tags) > @blogs = Blog.tagged_with(params[:id]) > end > > within each controller, along with the associated tag.html.erb in the > corresponding views folder > > It all seems to be working now, although I am pretty sure I am doing > it all wrong Doesn't look wrong to me. > since nothing of this nature is mentioned in the > documentation anywhere. Presumably the documentation expects that you know how variables are passed around between controllers and views in Rails. There is nothing out of the ordinary here. > Plus I have no idea how I am going to get > tags to work with another model at the same time, now... Probably the same way you did with this one. > > But thanks for the help It looks to me like you need a review of basic Rails practices. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

