First, please allow me to say I am very new to Rails and Ruby in
general. I have only been working with it... For about one month. I've
read every book and watched every screencast I could find on the
subject and as a result I am finally nearing the end of my first rail
app that will be going out live. But as you might guess, I'm having a
Being so new I'm a bit lost when it comes where code should go at
times and how exactly to handle RESTful resources.
Using the somewhat standard analogy of a blog, I have at the moment
three models and controllers. users, user_sessions, and posts (and the
controllers there of, ie, user_controller)
I am using acts_as_taggable_on (for tagging), authlogic (user login
behavior), mandraka-aegis(user roles) and white_list ( sanitation of
html from user's post).
I have tagging working. Giving the relative complexities of tagging, I
thought it would be a lot harder. However now, I want users to be able
to 'click' on a tag for a given post and find all posts with matching
tags. Now this is a trival thing, I can find them all easily however
my issue is that I do not know how to display this list of posts
I know this will likely seem obvious to the senior members here but
for me, it's not a question I can seem to come up with an answer for.
Should I create another new controller by itself to handle an Index or
Show action of the list? A model and a controller? add a new non-REST
custom method to the Post controller? Should I just recode the Post
controller to handle either single or multiple post displays? What is
the best method for redirecting to a list of these posts RESTfully?
I apologize ahead of time if this is a stupid question and a waste of
your time but it has me stumped. Thank you for your time.