| NewMonarch | and 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 |
| dwilkins | NewMonarch - 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. |
| AnakinKain | Hello,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. |
| dwilkins | Good for small groups - you don't get the subversion web interface with svn+ssh, though |
| AnakinKain | For 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. |
| werdnativ | jfenwick: typically yes, unless it's a "singleton", like session_controller |
| NewMonarch | hoping the designer on my team will adopt SVN. You think the web interface would make him a happier camper? |
| dwilkins | NewMonarch - 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 |
| jfenwick | werdnativ: thanks |
| AnakinKain | anyone? |
| NewMonarch | sounds like an easy enough question... someone gonna step up to the plate? |
| werdnativ | AnakinKain: what does post_id refer to in your posts table?/ |
| AnakinKain | sorry 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... |
| dushy7 | test |
| werdnativ | nope, that's wrong... Post.find_all_by_author_id( Post(params[:id]).author_id ).count |
| AnakinKain | hmmm.. |
| werdnativ | I'm sure there's a nicer way.... :-| |
| AnakinKain | i 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. |
| archetypo | AnakinKain 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 |
| AnakinKain | I tried .size |
| archetypo | find all by is deprecated i'm pretty sure |
| werdnativ | right, that's so obvious to look at it the other way... |
| AnakinKain | ok so what would the view call be? |
| archetypo | wait 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 |
| werdnativ | well, count gives you an integer... you put it into @postcount or such... then you do <%= @postcount %> in your view. |
| AnakinKain | ok. |
| archetypo | but 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 |
| werdnativ | try in your controller: @posts = Forum.find( params[:id] ).posts |
| jontec | I think there's an error in my rails code... as in the actual RAILS code... schema_statements.rb |