#rubyonrails - Sat 24 Mar 2007 between 22:22 and 22:42



NewMonarchand I don't have a lot of control
Any idea what the best configuration would be just based on that?
I'm able to use jailed SSH to get into the host to set up the repos
dwilkinsNewMonarch - That shouldn't be a problem - You'll have to manage htpasswd passwords, or some SQL database or something - Apache will be involved - you need apache 2.0 for most installations.
For personal projects, I use svn+ssh - you can use ssh keys to manage access.
AnakinKainHello,I am building a forum, I would like to count posts created by a specific user. from the posts table where post_id is the ids. And display it as a number to viewing users.
dwilkinsGood for small groups - you don't get the subversion web interface with svn+ssh, though
AnakinKainFor some reason it will pull out the total of the entire table as opposed to the number of only the posts with a specific post_id.
werdnativjfenwick: typically yes, unless it's a "singleton", like session_controller
NewMonarchhoping the designer on my team will adopt SVN. You think the web interface would make him a happier camper?
dwilkinsNewMonarch - no - you can't checkin, just look with the web interface - TortoiseSVN is the interface that clicky users use - it's great, and (should) work with svn+ssh
jfenwickwerdnativ: thanks
AnakinKainanyone?
NewMonarchsounds like an easy enough question... someone gonna step up to the plate?
werdnativAnakinKain: what does post_id refer to in your posts table?/
AnakinKainsorry I mean post.id is the id of the post table which is tied with the post being viewed, while the user_id is the user who posted it.
i have a pastie of the contoller and its view 01 http://pastie.caboo.se/49318
werdnativ@count = Post.find_all_by_author_id( params[:id] ).count # I think...
dushy7test
werdnativnope, that's wrong...
Post.find_all_by_author_id( Post(params[:id]).author_id ).count
AnakinKainhmmm..
werdnativI'm sure there's a nicer way.... :-|
AnakinKaini will definately try it.
I am just not sure how to link the view to that.
if you checked out the pastie, you will see what I mean.
archetypoAnakinKain if your model relationships are defined where authors has many posts and post belongs to author then you can do this several ways. one is count = author.posts.count or .size i think
AnakinKainI tried .size
archetypofind all by is deprecated i'm pretty sure
werdnativright, that's so obvious to look at it the other way...
AnakinKainok so what would the view call be?
archetypowait you are using dynamic finders which is fine, i was thinking of something else
well if you set an instance var you could dump @count
werdnativwell, count gives you an integer... you put it into @postcount or such... then you do <%= @postcount %> in your view.
AnakinKainok.
archetypobut you really don't need an instance variable. in hte view you could use erb with the author posts relationships
inst var for count, i mean
werdnativtry in your controller: @posts = Forum.find( params[:id] ).posts
jontecI think there's an error in my rails code... as in the actual RAILS code...
schema_statements.rb

Page: 3 10 17 24 31 38 45 52 59 66 73 80 

IrcArchive