Frederick Cheung wrote:
> Is your entries association funny in any way ?
> Fred
Hi Fred,
thanks. I have users and entries controller. In my show controller
(mydomain.com/profile/:username), I am using <% for entry in
@user.entries %> to show user posts. I dont know, if it is funny in any
way or not. :).
USERSCONTROLLER:
def show
@entry = Entry.new
username = params[:username]
@user = User.find_by_username(username)
@entries = @user.entries.paginate :per_page => 3, :page =>
params[:page], :order => 'created_at DESC'
.
.
.
end
ENTRIESCONTROLLER:
def show
@entry = Entry.find_by_id_and_user_id(params[:id], params[:user_id],
:include => [:user, [:comments => :user]])
end
THX
--
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
-~----------~----~----~----~------~----~------~--~---