similar to: Listing all of a nested Resources

Displaying 20 results from an estimated 20000 matches similar to: "Listing all of a nested Resources"

2006 Aug 28
1
Nested Resources failing..?
Hey I was wondering if anyone else was having problems with nested RESTful routes such as: map.resources :posts do |posts| posts.resources :comments end ?? It is not working for me, I have to declare it in the old prefix way, and it works fine... map.resource :comments, :path_prefix => ''/posts/:post_id'' Just wondering if others are having the same trouble before I do
2008 Apr 14
2
Problems with nil object
Hi to all. I''ve a very big problem. I know this can seem very loing, but please, try to read it. I have a simply blog, with posts and their comments. I''ve two tables in my db, posts, with post id, text and comments_count to store the number of comments-children of each post (as recomanded to do in AWDWR); and the table comments, with comment id, post_id for the post
2006 Jun 08
5
Displaying Calculation on Index
Hi, I am trying to create a simple point system and display the total on my index page. So I have my db basically setup like this: Posts id, body, created_at, user_id Post_points id, post_id, user_id, created_at, value So as you can see I am allowing other users to create points on the post and my db will store who gave the point as well. "value" is the point value which can
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe one of you guys can help me out. I''ll show my sweeper and then my log to show that it "should" be working. class PragmaticSweeper < ActionController::Caching::Sweeper observe Comment def after_save(comment) expire_page(comment.post_id) end private def expire_page(post_id)
2006 Jun 30
2
Simply Restful: Can''t create update forum
Views <code> <% form_for :user, @user, :url => { :action => "update" }, :method => :put do |f| %> ... <% end %> </code> Outputs <code> <form action="/users/1" method="post"> ... </code> It sends post instead of put. I don''t see any hackish hidden put stuff in the form either. -- Posted via
2009 Apr 15
2
Getting Started with Rails - post_comment_url
Hi, Thanks for a wonderful Getting Started with Rails. I am up to the last section and just added the comments part. So while testing and looking over comments_controller.rb; I see the reference to post_comment_url calll where is this defined. Below is the message I am getting. Thanks ActionController::RoutingError (post_comment_url failed to generate from {:post_id=>#<Post id: 1, name:
2006 Nov 27
3
Consistency in REST-routes naming
Hello everyone! In working with the Rails-REST-features I have always wondered about the URL for the new-action /objects/new In REST the URL should represent a Resource. As the semicolon is for adding non-standard actions (verbs) to a resource, IMHO it should be: /objects;new and not /objects/new In fact, this is just like an additional action, which I would specify with the
2009 Aug 16
5
any help with captcha in my comments ?
this is my error: Processing ApplicationController#create (for 127.0.0.1 at 2009-08-17 00:57:56) [POST] Parameters: {"comment"=>{"name"=>"asdasd", "body"=>"asdasd"}, "commit"=>"Add Comment", "post_id"=>"19",
2007 Aug 23
3
test/mocks/ in rails directory structure
Anyone ever uses test/mocks/development && test/mocks/test directories ? If someone does, test/mocks/development doesn''t really seem like a nice place for putting development environment mocked classes. May be mocks/ should be moved to RAILS_ROOT ? Or may be it should be removed. Views ? -- Cheers! - Pratik http://m.onkey.org
2006 Feb 24
4
too many components?
okay. on /posts/show/13 i have show.rhtml, which does render_component(:controller=>''comments'', :action=>''display_comments'', :id=>post.id) on comments/display_comments i iterate through the comments and then, display_comments.rhtml render_component(:controller=>''comments'', :action=>''new'', :id=>@id)
2012 Feb 07
6
nested route not receiving :id parameter within controller spec
I''ve got a share method in my controller, and I have the following spec: describe PostsController do describe "#share" do it "doesn''t blow up" do post :share, :id => @post.id end # ... etc And... It blows up! Failures: 1) PostsController#share shares Failure/Error: post :share
2006 Jun 01
2
when deleeting a post, delete all comments too
i can''t quite figure out how to delete all of a posts comments along with deleting the post. ive set up comments as belonging to posts and posts as having many comments and... Post.find(params[:id]).destroy ...works fine i just can''t figure out any way to delete that posts comments as well. comments uses the standard foreign key of post_id. thanks. -- Posted via
2007 Jun 28
23
DRYing link_to with a symbol
Hi, I just put in a patch that allows you to DRY up this: <%= link_to @company.name, @company %> to this: <%= link_to :name, @company %> The symbol indicates the method to be called on the object passed in the link_to options. http://dev.rubyonrails.org/ticket/8789 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2009 Dec 03
2
Dynamic Paths
Hey there, I''m in the muck of a major rails project, and need a bit of advice. Google isn''t much help in this case, so I came here. I''m trying to set up a URL structure as follows: url.com/username/blog/post_id where the user has_many posts and the post belongs_to user. I''m using the friendly_id plugin to enable easy lookup with the user''s username,
2006 Aug 05
0
Another generic CRUD controller
I''ve been using this template on most of my CRUD controllers. class CommentsController < ApplicationController meantime_filter :set_scope before_filter :find_comment, :only => %w(show edit update destroy) def index @comments = Comment.find(:all) end def new @Comment = Comment.new end def create @comment = Comment.create!(params[:comment])
2005 Mar 10
10
Some Basic Questions
Sorry I can''t access IRC from work so I hope you don''t mind me asking my newbie questions here: 1) I have the following code: @post = Post.find(@params[''id'']) @comments = Comment.find_all "post_id = #@params[''id'']", "created_on ASC" And I am have problems with the second line. I want to pass the id from my post to the
2007 Sep 14
4
Refactoring ActiveRecord's private methods
As it currently stands, ActiveRecord has alot of private and protected methods in the Base class. >> ActiveRecord::Base.methods.size => 427 >> ActiveRecord::Base.protected_methods.size => 32 >> ActiveRecord::Base.private_methods.size => 193 I really loved the suggestion by Courtenay in Refactoring AR::Base.find (http://groups.google.com/group/rubyonrails-core/
2012 Mar 12
4
how to design a api?
hi,everyone. now i start to design a api. the url like this http://localhost:3000/api?seckey=123&&post_id=1 the visitor need a seckey to access auth.and get info via json. so i dont think thats a good api. i need your answers.thx -- 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
2009 Apr 23
3
state of lfarkas KVM repository + Centos KVM wiki
Hi all, I have followed the wiki howto to install KVM on my C5 server with a F10 x86_64 guest. Howto here: http://wiki.centos.org/HowTos/KVM With one small problem here: http://www.centos.org/modules/newbb/viewtopic.php?post_id=74275&topic_id=19726 the guest is really running stable for one week now. Maybe someone could have a look at udev why it always sets permission for /dev/net/tun
2007 May 31
4
Sample Merb App
I put together a sample app to help people learn Merb: http://svn.depixelate.com/applications/invoice_tracker/ I also blogged about it here: http://depixelate.com/2007/5/31/taking-merb-for-a-spin -- Zack Chandler http://depixelate.com