Hmm, for some reason the log isn't showing the order by clause:
Rendering blogposts/show [4;35;1mBlogcomment Load (0.4ms) [0m [0mSELECT * FROM `blogcomments` WHERE (`blogcomments`.blogpost_id = 17) [0m [4;36;1mBlogcomment Columns (1.3ms) [0m [0;1mSHOW FIELDS FROM `blogcomments` [0m Completed in 133ms (View: 54, DB: 8) | 200 OK [http://localhost/ blogposts/17] On 7 July, 21:15, Jason Michael <chewman...@gmail.com> wrote: > take a gander at the development.log - find that sql query that is > being generated by that find. Try that query on your DBMS and see if > it returns the blogposts in the order you expect. > > On Wed, Jul 7, 2010 at 3:07 PM, RubyonRails_newbie > > > > <craigwest...@gmail.com> wrote: > > Hi everyone, > > > I have an app in which I am attempting to add a blog to. > > > I have the blog and commenting system working. It has 2 tables: > > > 1: blogposts (stores the actual blog topics/stories) > > 2: blogcomments (stores the comments for each blog created) > > > so - I've been playing around with the layout, as I think having the > > most recent posts at the top would be more logical. > > > Below is the code I have which creates the comment: (and attempts to > > order the comments accordingly) > > > def comment > > @blogcomment = Blogcomment.find(:all, :order => "created_at > > desc") > > > �...@user = User.find(session[:user_id]) > > > Blogpost.find(params[:id]).blogcomments.create(params[:comment]) > > flash[:notice] = "Added your comment" > > redirect_to :action => "show", :id => params[:id] > > > end > > > Any ideas? > > > Thanks for reading... > > > -- > > 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 rubyonrails-t...@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.