On Thu, Oct 11, 2012 at 6:23 AM, roelof <[email protected]> wrote: > Hello, > > I have this models > > class Berichten < ActiveRecord::Base > attr_accessible :bericht, :user > belongs_to :user > belongs_to :Category > end > > class User < ActiveRecord::Base > attr_accessible :email, :name > has_many :berichten > end > > class Category < ActiveRecord::Base > attr_accessible :id :name > has_many :berichten > end > > What I wonder is what the right url is when I want to place a new bericht > into a specific category. > Is it localhost:3000/<categoryname>/bericht/new ?
It depends on how you setup your resource and how you setup your controller. The model does not interact with the view and the view should not interact with the model directly under any circumstance, the controller hits up the model and then setups the view. Since you only showed us your model's and not your controllers we have no idea how you have it setup, though you can read more about routing here: http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions -- 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 https://groups.google.com/groups/opt_out.

