Ruby on rails - help with an active record query
I'm still at the early stages of learning so be gentle. However I used want to ask a question about an active record query I am trying to run.
I have set up a table for my users and have populated in, created the model and I can queries against it. I now want the user to be able to visit http://localhost/profile/show/1 (1 being the user_id) and show the stories they have entered. This also has a model and is working properly as I have constructed an index page which lists recent articles and another page which shows them.
However I can't get the articles for a selected user to appear on the profile page.
My code is below...
class ProfileController < ApplicationController
@user = User.find(params[:id])
@stories = Story.find :all, :conditions => "user_id = params[:id]"
Thanks in advance.
<p><%= @user.name %></p>
<% for story in @stories %>
<%= story.headline %>
<% end %>