Nested routes allow to capture relationship in your routing.
Questions tagged [nested-routes]
462 questions
0
votes
1 answer
How to pass arguements in Nested routes?
How to pass id in Nested routes path? I need to send picture_id.
<% @histories.pictures.each do |sAV| %>
<%= link_to 'Delete', history_pictures_path(histories_id:…
<%=image_tag sAV.pic (:medium) %>

Menporul Poriyalan
- 133
- 2
- 12
0
votes
1 answer
Rails - Import csv file into nested route
I have successfully gotten CSV files to be imported following the steps outlined in the Railscast 396 episode. However, now I'm trying to import a csv that is nested. I have seen other posts where people are trying to import both the parent and the…

M. Wood
- 63
- 7
0
votes
3 answers
Redirect_to rails 4 - could not find by lecture id
My models
class Course
has_many :lessons, through: :chapters
end
class Lesson
belongs_to :chapter
has_one :course, through: :chapter
end
class User
has_many :user_lessons
end
class UserLesson
#fields: user_id, lesson_id,…

AdrienNhm
- 165
- 1
- 10
0
votes
1 answer
Missing path after nesting routes
A basic question about what happens when routes are nested. I have a form that's complaining about a missing path. I'm unable to figure out how to either name the path correctly in routes, or correctly change the path it's looking for.
Here the…

Allan
- 2,586
- 5
- 26
- 22
0
votes
2 answers
No response to Show and Rails Routes
I have my file structure set up appropriately ( I think ! ) , and claims nothing responds to show.
My file structure :
views/admin/admin_wysi/index.html.haml
My controller ( controllers/admin/admin_wysis_controller.rb )
class…

Trip
- 26,756
- 46
- 158
- 277
0
votes
1 answer
Ember.js Routing: 'refreshModel: true' on queryParams without updating child route model
I would like to update a parent route on queryParams change, but not any child routes. To update my parent route on queryParam change, I use refreshModel: true.
According to: http://ember-doc.com/classes/Ember.Route.html#property_queryParams,…

Max
- 43
- 3
0
votes
2 answers
Nested Routes - Broken Form, NoMethodError - undefined method
To learn Rails, I'm working on a simple calendar app. To get started, I created two scaffolds and the proper associations/routes:
calendars
content_items
app/models/calendar.rb
class Calendar < ActiveRecord::Base
has_many…

JeremyE
- 1,368
- 4
- 20
- 40
0
votes
1 answer
Rails form_for edit not saving changes
I'm new to rails and having trouble getting my edit form to update attributes.
Here is my routes.rb for project and note:
resources :projects do
resources :notes
end
And this is my form_for in views/notes/edit.html.erb:
<%= form_for…
0
votes
2 answers
Nested Resources - UrlGenerationError - No route matches
I'm working on a basic Rails app. To get things going, I created two scaffolds.
calendar
content_items
I then created the proper associations.
app/models/calendar.rb
class Calendar < ActiveRecord::Base
has_many…

JeremyE
- 1,368
- 4
- 20
- 40
0
votes
2 answers
Routes error on [POST] [Ruby on Rails]
Right now I'm building a project management app in rails, here is some background info:
Right now i have 2 models, one is User and the other one is Client. Clients and Users have a one-to-one relationship (client -> has_one and user -> belongs_to…

Gotjosh
- 1,019
- 4
- 13
- 34
0
votes
1 answer
Rails - Debugging Nested Routes
I have 2 models, Assessments and Questions. Assessments have many questions.
In routes, I have:
map.resources :assessments, :has_many => :questions
map.root :assessments
I checked rake routes, it's as expected
On the form to create a new question,…

stringo0
- 2,720
- 7
- 38
- 52
0
votes
1 answer
Nested Resource Form For for Stripe Form
I need to find out how to set up a form_for for nested routes so I can pass the stripe token in a hidden field. For the documentation I've read and looked at my form_for set up looks correct but I am getting this error on the line that begin the…

Zippo9
- 706
- 2
- 5
- 24
0
votes
2 answers
Routing for self-referencing association in Rails 4
I am attempting to set up a route for a self-referencing nested association. The goal is to get a URL of /category_name/subcategory_name.
I'm using friendly_urls to get the category names instead of IDs. I've been able to get half of it to work…

Chris Remst
- 41
- 1
- 6
0
votes
0 answers
Error message regarding routes when trying to implement message system into rails app
I am trying to implement a message system into my rails project but Ive been stuck for the past few days.. .
1) What I ve done so far
in db/schema file:
create_table "messages", force: :cascade do |t|
t.integer "conversation_id"
t.integer …

David Geismar
- 3,152
- 6
- 41
- 80
0
votes
1 answer
` No route matches` error for Nested Resources Controller Spec - Rails, Rspec
I keep getting No route matches error for a nested resource #create action. Here is what I got:
routes:
...
resources :users, only: [:show, :create] do
resources :filters, only: [:new,:create]
end
...
controller spec:
...
context 'with valid…

dimitry_n
- 2,939
- 1
- 30
- 53