Tagged Questions
0
votes
0answers
5 views
On 301 rails redirect, .htm is loading correct page but keeping old path
I am creating 301 redirects for a rails 3 app. All of the redirects work correctly except one. Rails is reading the .htm as a format because the file name is the same as one of my controllers. So ...
0
votes
3answers
17 views
How to call a controller method to populate partial on root page?
I've got a controller method:
def latest_blogs
@latest_blogs = BlogEntry.all.order('dato DESC').limit(4)
end
A root html.erb file which acts as my home page:
<div class="body-box">
...
0
votes
2answers
18 views
Rails - what's the correct path for inner controllers?
I have this setup in the routes.rb:
resources :users do
resources :images do
resources :comments
end
end
When I load the show action from the ImagesController, this is what is in the ...
1
vote
2answers
27 views
Route appears in rake routes, but not on site
I'm new to ruby on rails, and I'm having trouble getting up to speed. I've set up devise for user authentication, and everything seemed to be going well. Until I tried to get routes set up
...
0
votes
0answers
31 views
Better way to make nested resources?
In routes.rb I have the following code to create nested paths for students and subjects under student_groups:
resources :student_groups do
resources :students, :subjects
end
I then want to nest ...
1
vote
1answer
24 views
Dual-parent nested resources or is polymorphism right for me?
I have a model called evaluation that belongs_to two other models - student and goal.
While researching how to set up this association for routing, at first I thought a polymorphic association would ...
0
votes
1answer
20 views
Ruby on Rails: Can you prefix a parameter before the controller name with routes.rb?
I'm building a Rails application where I want to prefix a parameter (i.e., a customer code) before the controller name like so:
/customer_code/jobs
and
/customer_code/jobs/new
would route to ...
1
vote
0answers
19 views
How to add custom verb (http request method ) to rails4
I want to add custom http VERB to rails 4
here is my routes.rb
ring "/session/" => "calls#ringing"
and I also puts this code to initializers
%w(ring busy).each do |method| ...
0
votes
1answer
38 views
generate routes for one page landing pages?
I am attempting to build a simple webpage using Rails and this guide to great looking landing pages by William Ghelfi (thanks!) ...
1
vote
1answer
39 views
Adding :user_id to a resource (rails3 routing)
I am trying to set up routes for the "Page" model nested within the "User" model. Only "Pages" needs to be resourcesful. (User has_many pages)
This is the original way I did it:
resources :users, ...
0
votes
2answers
34 views
How to use ruby on rails named routes
I defined nested resources like this
resources :item, :only => [:create, :destroy, :update] do
resources :item_image, :only => [ :new, :create, :show , :destroy, :index]
end
And my ...
0
votes
3answers
37 views
Rails get routing with parameter
I want to create a new route in my routes.rb which points to a "courses" controller which has the method pdfdownload. The route is supposed to take 2 parameters: course_id and user_id. I thought it ...
0
votes
3answers
42 views
Rails How to get output of url as string
How to get the xml output of a view/controller as string within the same controler
This is the routes file
routes.rb
map.ccda '/ccda/ccda_patient_search', :controller => 'ccda', :action => ...
1
vote
0answers
40 views
Rails undefined method `model_name' in long path form partial
I have such long route (yes, it is not best, but let's for a while forget about it):
namespace :admin do
namespace :catalogs do
namespace :to do
namespace :to_manufacturers do ...
3
votes
2answers
40 views
Internationalization of static pages with Rails
I feel like I'm missing something really simple and I keep spinning my wheels on this problem.
I currently have internationalization working throughout my app. The translations work and the routes ...