Hi all,
I'm building a Pylons application using evoque as our templating engine, though I think my question is relevant to other template engines. I have a base template that I'm using for our pages, and that base template does all the includes for CSS and Javascript files. I'd like to perform conditional test to include/exclude CSS and...
I have a singular nested resource like so:
map.resources :bookings, :member => { :rate => :post } do |booking|
booking.resource :review
end
Giving me these routes:
new_booking_review GET /bookings/:booking_id/review/new(.:format) {:controller=>"reviews", :action=>"new"}
edit_booking_review GET /bookings/:booki...
I have a Customer list that will have Invoices and Emails linked to it.
I have my customer/details/1 and customer/edit/1 working as per the default route but would like to have it instead be like below
customer - Lists customers
customer/1/edit - Edit Customer ID 1
customer/1/details - Details of Customer ID 1
customer/1/invoice...
Hello guys, I'm building currently one Rails app and I'd like to stick to all those fancy things like REST and Resources, but I'd like to customise my routes a little. I want my GET route to be little more verbose - the app I'm creating is a simple blog, so instead of GET /posts/1 I'd prefer something like GET /posts/1-my-first-post.
An...
Hello,
I'm not exactly sure how to frame this question so I'll just go for it. I am recently returning to rails after a hiatus and I am building a social networking style application. Basically I'd like to do what twitter does and have each persons profile page be found at "http://www.url.com/username" and while I have managed to get th...
Hello,
I am trying to implement user-friendly URLS, while keeping the existing routes, and was able to do so using the ActionName tag on top of my controller (http://stackoverflow.com/questions/436866/can-you-overload-controller-methods-in-asp-net-mvc)
I have 2 controllers:
ActionName("UserFriendlyProjectIndex")]
public ActionResult I...
I have a Model Property which has subclasses using STI,
and which I would like all to use the same controller with only different view partials depending on the subclass.
Property
Restaurant < Property
Landmark < Property
It works find except I'm not sure how to discern the subclass inside the controller to render the correct view. ...
Topic says it all guys, my program needs to be able to keep track of the "software" that belongs to a user, as such I have a MVC for "Software". However, I can't use RESTful routes at the moment since my plural and singular names are the same, it's "software" for both. Can anybody help me either, create new named routes or suggest a ne...
Is there a simpler way of writing this:
map.old_site_cusom_packages '/customs_packages_options.html', :controller => :public, :action => :redirect_to_home
map.old_corporate '/corporate.html', :controller => :public, :action => :redirect_to_home
map.old_track '/track.html', :controller => :public, :action => :redirect_to_home
map...
Routes in Ruby on Rails are case sensitive. It seems someone brought this up before, and it has been labeled will not fix.
http://rails.lighthouseapp.com/projects/8994/tickets/393-routes-are-case-sensitive
That strikes me as unfortunate, as I don't really see any upside on my own application for routes to be case sensitive, while on th...
I've used will_paginate in a number of projects now, but when I moved one of them to Rails 2.3.5, clicking on any of the pagination links (page number, next, prev, etc.,) went from getting nice URLs like this:
http://foo.com/user/1/date/2005_01_31/phone/555-6161
to this:
http://foo.com/?options[]=user&options[]=date&options[]...
I have a basic MVC 2 (RC2) site with one base-level controller ("Home"), and one area ("Admin") with one controller ("Abstract"). When i call http://website/Abstract - the Abstract controller in the Admin area gets called even though i haven't specified the Area in the URL. To make matters worse - it doesn't seem to know it's under Admin...
I'm creating a simple quiz application where a question can have multiple answers. To improve the usability of my app, I want users to be able to edit ALL the answers for a given question in the same form:
I found this great Railscast/Asciicast episode which does almost EXACTLY what I want to do
http://asciicasts.com/episodes/198-edit-...
I have a primary model for my project, Place.rb with a places_controller, and I've currently got it exactly the way I want for the users end of my project. With a nested photos controller, review, etc.
I want now to create a management resource which is mostly just an alias for Places, with its own nested resources, some of them overla...
Hello!
I have this in routes.rb
map.namespace :admin do |admin|
admin.resources :projects, :has_many => :products
end
What I would like to is to be able to set the something in the routes.rb file in order for me to use new action in the products controller. Actions added by hand after scaffolding.
I tried something like this
m...
I have a simple web app with users and posts. I have an index controller and view that shows a list of the posts in the database. With the list, it shows a "Show" link which links to the specific post.
I am trying to replicate that for users but something is going wrong. I have an index view that shows all the users in the database and ...
I'm trying to model class and sections of a class and further instances of sections.
so route should be
Class/ (Create, Details, Index, Edit) for classes
Then I've a section controller
ClassSection
so I would do
Class/1/ClassSection/ (Create, ... ) since ClassSection without classid is useless
and then further
Class/1/ClassSecti...
When we define routes in routes.rb using the name like map.some_link we can use the link in two ways- some_link_url() some_link_path. What are the differences between the two? Which is more secure to be used?
...
I want to setup a route so that if the user goes to http://mysite.com/page.html it is routed to the controller page_controller and the action index. How would I do this?
...
The following code:
map.resources :users, :has_many => :items
Could be written like this in a block:
map.resources :users do |user|
user.resources :items
end
How could I write the following code in a block?
map.resources :users, :member => { :start => :post }
Also, where could I find documentation on writing routes in blocks?...