Re: [Rails] routes

2017-09-15 Thread Joe Guerra
ries_controller.rb >>> invokeerb >>> create app/views/galleries >>> invoketest_unit >>> create test/controllers/galleries_controller_test.rb >>> invokehelper >>> create app/helpers

Re: [Rails] routes

2017-09-14 Thread Colin Law
gt;> invoke test_unit >> invokeassets >> invoke coffee >> createapp/assets/javascripts/galleries.coffee >> invoke scss >> createapp/assets/stylesheets/galleries.scss >> inv

Re: [Rails] routes

2017-09-13 Thread Joe Guerra
/assets/javascripts/galleries.coffee > invoke scss > createapp/assets/stylesheets/galleries.scss > invoke resource_route >routeresources :galleries > [ruby-2.4.1p111] tmp/example (master #%) $ cat config/routes.rb > Rails.applica

Re: [Rails] routes

2017-09-12 Thread Rob Biedenharn
rces :galleries # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end [ruby-2.4.1p111] tmp/example (master #%) $ rails routes Prefix Verb URI Pattern Controller#Action galleries GET/galleries(.:format) galleries#index

Re: [Rails] routes

2017-09-11 Thread Norbert Melzer
Routes do not belong to a model, they map request pathes to actions in controllers, so can you please go into a little bit more detail? On Mo., 11. Sep. 2017, 19:05 Joe Guerra wrote: > I believe I messed up the routes in one of my models. > > Should I delete the model and

[Rails] routes

2017-09-11 Thread Joe Guerra
I believe I messed up the routes in one of my models. Should I delete the model and try again? Thanks, Joe -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [Rails] Rails, routes, angularjs

2016-03-04 Thread Colin Law
On 4 March 2016 at 12:15, Gm wrote: > The requests are displayed in the firebug console for example. Ah, I thought you meant the server console window. I should probably have realised, as you said it was angular code. How to stop stuff displaying in the FF console is not a

Re: [Rails] Rails, routes, angularjs

2016-03-04 Thread Gm
The requests are displayed in the firebug console for example. On Friday, March 4, 2016 at 9:11:26 AM UTC-3, Colin Law wrote: > > On 4 March 2016 at 12:03, Gm wrote: > > Hi, > > > > I'm using AngularJS with Rails and I have a problem. > > My angular code makes several

Re: [Rails] Rails, routes, angularjs

2016-03-04 Thread Colin Law
On 4 March 2016 at 12:03, Gm wrote: > Hi, > > I'm using AngularJS with Rails and I have a problem. > My angular code makes several call to an API and all requests are displayed > in the console. > I think it's a problem because I'm exposing some parameters and informations >

[Rails] Rails, routes, angularjs

2016-03-04 Thread Gm
Hi, I'm using AngularJS with Rails and I have a problem. My angular code makes several call to an API and all requests are displayed in the console. I think it's a problem because I'm exposing some parameters and informations about my API. Is there a way to hide these requests ? How can I

[Rails] Re: Need clarification on rails routes created when a controller is generated

2015-07-02 Thread Mike
You can always use the 'as' modifier get 'monthly_reciept/new', as: 'new_monthly_receipt' will give you the ability to use new_monthly_receipt_path On Thursday, 2 July 2015 03:50:32 UTC+1, Padmahas Bn wrote: I cannot find this in rails guides and rake routes doesn't show any helper for this

[Rails] Need clarification on rails routes created when a controller is generated

2015-07-01 Thread Padmahas Bn
Hello all, When a controller is generated, rails adds an entry in routes.rb for that controller and action like this. get 'monthly_reciept/new' But it don't create helper for this route as in this eg: get'login' = 'sessions#login' Using the second route, I can write *login_path *in any

[Rails] Re: Need clarification on rails routes created when a controller is generated

2015-07-01 Thread Padmahas Bn
I cannot find this in rails guides and rake routes doesn't show any helper for this route because there is no one. Sorry. I copy pasted the route to the end so that I can find quickly but rake seems not to list the helper repeatedly. I found the helper monthly_receipt_new when I

Re: [Rails] [routes] in #destroy send parameters in a json

2015-04-24 Thread Colin Law
On 23 April 2015 at 20:54, Diego b diego.br...@gmail.com wrote: in destry route: how to send parameters in a json want a route to: - Call delete: destroy, {another_param: myPara format: 'json'} It is not clear what it is that you do not know how to do. Is it how to post json with a delete

[Rails] [routes] in #destroy send parameters in a json

2015-04-24 Thread Diego b
in destry route: how to send parameters in a json want a route to: - Call delete: destroy, {another_param: myPara format: 'json'} -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from

[Rails] routes for devise in rails4

2013-07-09 Thread Thomas Chik
How about an authorization solution like cancan. Have a single sign in point and redirects based on user rights. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an

[Rails] routes for devise in rails4

2013-07-08 Thread mack gille
hi all, i am using 3 devises for 3 models in rails4. i need routes to my devise models.the devises are client,admin,employee. when i login into client then it will go to clients dashboard, when i login into admin then it will go to admins dashboard, the employee also has the employee dashboard.

[Rails] routes for new resources

2012-08-17 Thread John Merlino
Does anyone know what the controller code would look like for a route like this: resources :reports do new do post :preview end end and a helper that looks like this: preview_new_report_path thanks for response -- You received this message because you are subscribed to the Google

[Rails] routes are loaded (config/routes.rb) AFTER all the initializers(config/initializers)

2012-06-24 Thread drrs
Where in Rails 3 (3.1, 3.2) source code we can see and confirm that routes are loaded (config/routes.rb) AFTER all the initializers(config/initializers)? Thanks. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on

[Rails] routes ressources and namespace

2012-05-17 Thread Greg
Hi all, I created a namespace for my categories resource. I removed the show action because otherwise I would get this kind of route for my show action: /admin/categories/:id namespace :admin do resources :categories, :except = :show end What I want for the show action is a route like

[Rails] routes issues with rails3

2012-02-29 Thread amvis
Here i am using *rails3*, here the view.html.erb form have one login button, so when i click on that button, gives no routes matches :controller = 'home', :action = 'login'. But i have put that in routes.rb. Why this happening? *view.html.erb* %= form_tag( { :controller = 'home', :action =

[Rails] Re: Rails routes - destroy

2012-02-12 Thread Dave Castellano
Peter Vandenabeele wrote in post #1045942: On Sun, Feb 12, 2012 at 4:14 AM, Dave Castellano li...@ruby-forum.comwrote: minisection_question GET question! There are 2 aspects: 1) resourceful routing In e.g. the Rails Routing from the Outside In tutotial

Re: [Rails] Re: Rails routes - destroy

2012-02-12 Thread radhames brito
Thank you! Your referral to the API for the link_to led to this: Note that if the user has JavaScript disabled, the request will fall back to using GET. I was really on the wrong track! I recently upgraded to Rails 3.2 and most of my Javascript stopped working. I was going to try to

[Rails] Rails routes - destroy

2012-02-11 Thread Dave Castellano
Can't figure out how duplicate routes are differentiated by rails ... Read routing from inside out and API as well as a few tutorials but still don't get it!!! For example... routes.rb resources :minisections do resources :questions end rake routes: minisection_question GET

Re: [Rails] Rails routes - destroy

2012-02-11 Thread Peter Vandenabeele
On Sun, Feb 12, 2012 at 4:14 AM, Dave Castellano li...@ruby-forum.comwrote: Can't figure out how duplicate routes are differentiated by rails ... Read routing from inside out and API as well as a few tutorials but still don't get it!!! For example... routes.rb resources :minisections do

Re: [Rails] routes matching different path for different users.

2011-12-05 Thread Mauro
On 1 December 2011 17:13, Craig White craig.wh...@ttiltd.com wrote: On Dec 1, 2011, at 8:28 AM, Mauro wrote: On 1 December 2011 00:54, Craig White craig.wh...@ttiltd.com wrote: On Nov 30, 2011, at 3:31 PM, Mauro wrote: I want to display different layouts based on user. If user is intraOp

Re: [Rails] routes matching different path for different users.

2011-12-05 Thread Hassan Schroeder
On Mon, Dec 5, 2011 at 3:13 AM, Mauro mrsan...@gmail.com wrote: To do this I am thinking to set a session variable called, for example, session[:intra] or session[:inter]. The choice If to use session[:intra][ or session[:inter] is done looking at url. If localhost/intra then I use intra

[Rails] routes problem

2011-12-01 Thread Vogon Primo
Hi all, In a sample project, I have a nested resource called ticket, and parent resource called project. rake routes: ... project_tickets GET/projects/:project_id/tickets(.:format) {:action=index, :controller=tickets} POST

Re: [Rails] routes matching different path for different users.

2011-12-01 Thread Mauro
On 1 December 2011 00:54, Craig White craig.wh...@ttiltd.com wrote: On Nov 30, 2011, at 3:31 PM, Mauro wrote: I want to display different layouts based on user. If user is intraOp the I want to use layout intraOp, if user is interOp I want to display layout interOp while if controller_devise

Re: [Rails] routes matching different path for different users.

2011-12-01 Thread Craig White
On Dec 1, 2011, at 8:28 AM, Mauro wrote: On 1 December 2011 00:54, Craig White craig.wh...@ttiltd.com wrote: On Nov 30, 2011, at 3:31 PM, Mauro wrote: I want to display different layouts based on user. If user is intraOp the I want to use layout intraOp, if user is interOp I want to

[Rails] routes matching different path for different users.

2011-11-30 Thread Mauro
I want to display different layouts based on user. If user is intraOp the I want to use layout intraOp, if user is interOp I want to display layout interOp while if controller_devise I want to display application layout. I based the user selection on request.path. If request.path is /intraOp then

Re: [Rails] routes matching different path for different users.

2011-11-30 Thread Craig White
On Nov 30, 2011, at 3:31 PM, Mauro wrote: I want to display different layouts based on user. If user is intraOp the I want to use layout intraOp, if user is interOp I want to display layout interOp while if controller_devise I want to display application layout. I based the user selection

[Rails] [Routes][Gem] assert can't see route

2011-10-23 Thread pemeon
Hello, I have problem with routes in my gem. I have this example code for adding routes : module ActionDispatch::Routing class Mapper def gallery_for match /gallery/get/:id = gallery/ view#get, :as=:gallery_galleries_by_user_id end end end And I'm

[Rails] routes question

2011-08-12 Thread 7stud --
Why does this link: h1Pages#home/h1 pFind me in app/views/pages/home.html.erb/p %= link_to Update clicks , { :controller = 'users', :action = 'update_clicks'} % ...route me to the users/show page? Here are my routes: Test2App::Application.routes.draw do resources :users root :to =

Re: [Rails] routes question

2011-08-12 Thread Chris Mear
On 12 Aug 2011, at 21:07, 7stud -- wrote: Why does this link: h1Pages#home/h1 pFind me in app/views/pages/home.html.erb/p %= link_to Update clicks , { :controller = 'users', :action = 'update_clicks'} % ...route me to the users/show page? Here are my routes:

[Rails] Routes and Namespace

2011-06-01 Thread Vinícius Rodrigues
Could someone explain me how to work with routes and namespaces? I need to understand it urgent to build an application. Thanks! -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

Re: [Rails] Routes and Namespace

2011-06-01 Thread Fábio Rodriguez
http://guides.rubyonrails.org/routing.html On Jun 1, 2011, at 10:13 AM, Vinícius Rodrigues wrote: Could someone explain me how to work with routes and namespaces? I need to understand it urgent to build an application. Thanks! -- You received this message because you are subscribed to

Re: [Rails] Routes and Namespace

2011-06-01 Thread Vinícius Rodrigues
I did so: match 'home' = 'home#index' namespace :payable do resources :account end root :to = 'home#index' I can access the route home/index, but can not access the route payable /accounts/index, he finds Payable::AccountsController but says he does notfind the :id = 'index' Could someone

Re: [Rails] Routes and Namespace

2011-06-01 Thread Fábio Rodriguez
Hi, try add the following: match ':controller(/:action(/:id))' match 'home' = 'home#index' namespace :payable do resources :account end root :to = 'home#index' On Jun 1, 2011, at 10:30 AM, Vinícius Rodrigues wrote: I did so: match 'home' = 'home#index' namespace :payable do

Re: [Rails] Routes and Namespace

2011-06-01 Thread Vinícius Rodrigues
Actually my last line reads: Sisteger::Application.routes.draw do match 'home' = 'home#index' namespace :payable do resources :account end root :to = 'home#index' match ':controller(/:action(/:id(.:format)))' end I generated the model and controller as follows: rails g model

Re: [Rails] Routes and Namespace

2011-06-01 Thread Fábio Rodriguez
You don't need to do rails g model Payable/Account just Account works On Jun 1, 2011, at 10:50 AM, Vinícius Rodrigues wrote: Actually my last line reads: Sisteger::Application.routes.draw do match 'home' = 'home#index' namespace :payable do resources :account end root :to =

Re: [Rails] Routes and Namespace

2011-06-01 Thread Vinícius Rodrigues
But I need two scenarios: Accounts Payable (Payable::AccountsController) Accounts Receivable (Receivable::AccountsController) But I can not work! :( -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

Re: [Rails] Routes and Namespace

2011-06-01 Thread Fábio Rodriguez
You can generate just one model and set a flag with the type of Account: for MongoId: field :account_type, :type = String, :default = 'P' And in the controllers you can search with @accounts = Account.where(:account_type = 'P') This can solve your problem but it's not the best way to do it. I

Re: [Rails] Routes and Namespace

2011-06-01 Thread Vinícius Rodrigues
I see, I thought so too. But do not think the best way But it is a solution! I'll have to implement anyway! Thanks! -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

Re: [Rails] Routes and Namespace

2011-06-01 Thread stephano zanzin
So you are using the wrong syntax. You should use rails g controller Accounts/Payable, etc. Anyway, I think you are a bit confused and must organize your knowledge flow. Start reading the Getting Started from Guides, http://guides.rubyonrails.org/getting_started.html. 2011/6/1 Vinícius Rodrigues

[Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-28 Thread egervari
Try running rake routes and see what you get then either use what you have available or modify so you have the route you want. Well, that was the problem - it's not about the routes being - it was about rails doing the wrong thing. The solution was to put: [:admin, @company] And then

[Rails] Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread egervari
I have a design question where I would appreciate a thoughtful response. Let's say you have a simple application (for example's sake) that has a User, Company and Theme model. A Company `has_one` Theme and `has_many` Users. Administrators (a User) can fully manage Companies and Themes - the

[Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread egervari
Oh, I also want to add that Admins will manage Users too, not just Companies and Themes. So there is a conflict where Companies can create/edit/delete Users and use/not use the same controller. There is also potential route conflicts unless you use nested resources. I also want to add that Admins

Re: [Rails] Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 7:55 PM, egervari ken.egerv...@gmail.com wrote: I have a design question where I would appreciate a thoughtful response. Let's say you have a simple application (for example's sake) that has a User, Company and Theme model. A Company `has_one` Theme and `has_many`

Re: [Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 8:00 PM, egervari ken.egerv...@gmail.com wrote: Oh, I also want to add that Admins will manage Users too, not just Companies and Themes. So there is a conflict where Companies can create/edit/delete Users and use/not use the same controller. There is also potential

[Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread egervari
On May 27, 9:02 pm, David Kahn d...@structuralartistry.com wrote: On Fri, May 27, 2011 at 7:55 PM, egervari ken.egerv...@gmail.com wrote: I have a design question where I would appreciate a thoughtful response. Let's say you have a simple application (for example's sake) that has a User,

[Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread egervari
How do you deal with form_for's when the routes are nested? For example, let's say you have a Admin::CompaniesController in your :admin namespace. The model is obviously Company. I get an error for new forms: %= simple_form_for(@company, :url = admin_company_path(@company)) do |f| % Here's

Re: [Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 9:11 PM, egervari ken.egerv...@gmail.com wrote: How do you deal with form_for's when the routes are nested? For example, let's say you have a Admin::CompaniesController in your :admin namespace. The model is obviously Company. I get an error for new forms: %=

[Rails] Routes - Search url parser

2011-05-08 Thread danimashu
Hello, I'm trying to set my routes.rb. I have Car that belongs to Color and Brand. I want to build a clear url searcher without visible variables. It's working for me this: resources :Cars match 'color/:color' = 'cars#index' match 'brand/:brand' = 'cars#index' match 'brand/:brand/color/:color' =

[Rails] routes question rails 3.0 vs. rails 2.0

2011-04-16 Thread sol.manager
I have been trying to get Solr up and running and have an app mostly working but simple routes stuff is tripping me up. This is a Rails 3.0 route. PlayingWithSunspot::Application.routes.draw do resources :jobs do collection do get :search end end So, what would the Rails 2.3.11

Re: [Rails] routes question rails 3.0 vs. rails 2.0

2011-04-16 Thread Phil Crissman
Phil On Sat, Apr 16, 2011 at 9:29 PM, sol.manager sol.mana...@gmail.com wrote: I have been trying to get Solr up and running and have an app mostly working but simple routes stuff is tripping me up. This is a Rails 3.0 route. PlayingWithSunspot::Application.routes.draw do resources :jobs

Re: [Rails] Routes and REST Issue

2011-03-29 Thread Frederick Cheung
On 28 Mar 2011, at 22:52, Peter Laurens li...@ruby-forum.com wrote: match 'sessions' = 'sessions#create', :via = :put match 'sessions' = 'sessions#destroy', :via = :delete Essentially I want a user to send a put (this is an idempotent operation) to the sessions collection URL, with

[Rails] Routes and REST Issue

2011-03-28 Thread Peter Laurens
Hi all, A relative newcomer to routes here - I have a controller on which I would like to be able to specify only a couple RESTful operations (my example is for a RESTful user sessions controller, where it only makes sense to (1) create a session, and (2) destroy a session). Using 'resources' on

Re: [Rails] Routes and REST Issue

2011-03-28 Thread Phil Crissman
Phil On Mon, Mar 28, 2011 at 4:52 PM, Peter Laurens li...@ruby-forum.com wrote: Hi all, A relative newcomer to routes here - I have a controller on which I would like to be able to specify only a couple RESTful operations (my example is for a RESTful user sessions controller, where it only

[Rails] Routes problems

2011-03-20 Thread kouzma
Hello. I have many links like these: /articles/... /albums/... /photos/... etc. I need to use the name of the city in the beginning of urls if the user has choosed it: /city_name/articles/... /city_name/albums/... /city_name/photos/... But previous links shoul work too (/articles/...,

[Rails] Routes - Making Delete a Collection Operation

2011-03-20 Thread Peter Laurens
match through to the destroy method. I'm new to Rails routes, so any help would be much appreciated! Thanks, - Nex -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

Re: [Rails] rails routes into application.js

2011-02-06 Thread Mauro
On 5 February 2011 19:23, Jason Lewis jasonlewi...@gmail.com wrote: Well, it depends on whether it's a link or form. It is just a button: button id=printedPrint/button -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] rails routes into application.js

2011-02-05 Thread Mauro
There's a way to use rails routes into a jquery function puts inside the file application.js? I want to do something like this: $(#printed).click(function() { $.get(customer_path(@customer)) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

Re: [Rails] rails routes into application.js

2011-02-05 Thread Jason Lewis
; }); Jason Lewis Email jasonlewi...@gmail.com Mobile 410.428.0253 AIM canweriotnow Facebookhttp://www.facebook.com/canweriotnow On Sat, Feb 5, 2011 at 12:26 PM, Mauro mrsan...@gmail.com wrote: There's a way to use rails routes into a jquery function puts inside

[Rails] Routes not working

2011-01-19 Thread Jeff Miller
Hello everyone, I've been using RoR for awhile now, but I'm new to Rails 3... I'm trying to follow a tutorial that creates a registration page that creates a user. Simple enough, right? When I go to server:3000/user/register, it comes up with my registration page fine. However, when I submit it

[Rails] Before and After Filters/Functions for Rails Routes

2011-01-16 Thread Oguz Bilgic
Hi I have an idea and I am not sure if is is already done.Right now to make url search engine friendly developers use to_param function of model class. Then they call to_s function to get the id of the elmenet. What if I want to create url for not model but for string. Lets say I create link

[Rails] Re: Before and After Filters/Functions for Rails Routes

2011-01-16 Thread Oguz Bilgic
here is the link for stackoverflow version http://stackoverflow.com/questions/4705304/before-and-after-filters-functions-for-rails-routes -- 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 rubyonrails

[Rails] Routes problem in form

2011-01-09 Thread JD
Hello all, I'm relatively new to rails and have been doing ok with it but I have run into an issue that I'm sure has a really easy solution that I just can't seem to see. Basically I have an app and have namespaced and admin section to it. I'm getting the following error: No route matches

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-20 Thread Ahmy Yulrizka
when you specify route inside resource, AFAIK if you specify the route inside collection, rails will always append ies like priorities if you specify the route inside member, rails will always use the singular word liake priority so in that way, one solution (but i dont know if this the best way

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-20 Thread Mahmoud Said
Bourne, In your example, *add* is like *new. *It should not be a member action, it is a collection one. I think what you are asking for is a bit more elaboration of the default REST routes. When you do: resources :priorities This will generate the 7 default routes. which are two types:

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-20 Thread Mahmoud Said
Given that you already know what we mentioned. and the correct usage is resources :priorities do collection do get 'add' end end I think what confuses you is: why is it add_priorities_path and not add_priority_path like the new_priority_path (in a singular form)? is that right ?

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-20 Thread bourne
On Monday, December 20, 2010 9:44:36 AM UTC+1, modsaid wrote I think what confuses you is: why is it add_priorities_path and not add_priority_path like the new_priority_path (in a singular form)? is that right ? Correct :) (I know that this behaviour is fine for collections but I

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-20 Thread Mahmoud Said
that's interesting, apparently there is 3rd type other than collection and member that is specific to the new. if u checked at actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:953 you can how the default routes are added: collection do get :index if

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-20 Thread Mahmoud Said
it won't work, it will be add_new_priority GET/priorities/new/add(.:format){:action=add, :controller=priorities} however, the collection plural form seems more logical to me, you are adding a priority to priorities. so you are actually acting on priorities On Mon, Dec 20, 2010 at

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-20 Thread Ahmy Yulrizka
This is interesting, it doesn't work because if you call member, the resource mapper call member_scope, which in turn yield # File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 503 def member_scope #{path}/:idend but the new is very special method, it call new_scope which in turn

[Rails] Routes: How would default routes be defined manually?

2010-12-19 Thread bourne
I am quite new to rails and even after reading the docs to routes I still do not manage to simply duplicate the new route: %= link_to 'New Priority', new_priority_path % -- %= link_to 'Add Priority', add_priority_path % resources :priorities do member do get 'add' end rake routes:

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-19 Thread Ahmy Yulrizka
I think you forgot end over there .. resources :priorities do member do get 'add' end end also to check your routes, do rake routes on your rails root Ahmy Yulrizka On Sun, Dec 19, 2010 at 8:15 PM, bourne bour...@gmail.com wrote: resources :priorities do

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-19 Thread bourne
No, I just failed on copy/paste and lost the end in the original post when removing the up-route :/ resources :priorities do member do get 'up' get 'add' end collection do end end rake routes (complete) up_priority GET

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-19 Thread Ahmy Yulrizka
Im trying to figure out what is it that you want. And if im not mistaken, you want to add priority to behave the same as new_priority. when you declare resource , rails automaticly assign 7 route respect to REST the member method inside of the resource would apply to single instance of the

Re: [Rails] Routes: How would default routes be defined manually?

2010-12-19 Thread bourne
Thank you! Your post is really helpful. As mentioned above, I just want to understand how I would declare the 7 REST routes if they would not have been declared for me, e.g. new1 (add in my example), edit1, ... If I declare add as a collection route, this statement throws an error %= link_to

[Rails] routes friendly URL's

2010-11-30 Thread andyl
I have a Rails3 app with three resources: - League (has_many :teams) - Team (belongs_to :league, has_many :players) - Player (belongs_to :team) With standard nested routes, I get URLs like: /leagues (lists all leagues) /leagues/2(shows league #2) /leagues/2/teams (lists all

Re: [Rails] routes friendly URL's

2010-11-30 Thread Brian Troutwine
On Tue, Nov 30, 2010 at 11:26 AM, andyl akl...@gmail.com wrote: I have a Rails3 app with three resources: - League (has_many :teams) - Team (belongs_to :league, has_many :players) - Player (belongs_to :team) With standard nested routes, I get URLs like: /leagues          (lists all

[Rails] Routes Refactoring

2010-11-11 Thread andyl
I have a simple rails3 app that has three nested resources: Team has_many Groups Group has_many Tools To build the app quickly, I used standard restful practices, giving URL's like: /teams/1 /teams/1/groups /groups/1 /groups/1/tools /tools/1 Now I'd like to make the URL's more readable:

[Rails] Routes Id issue in 2.3.5

2010-10-08 Thread The_programmer
Hi, Routes.rb wants the id for doctors. I would love to give routes the answer it is looking for, but I am not sure how to define an id in rails. In c++ it would be something like int doctors(int id); int doctors(int id) { // code } If someone could be kind enough to tell me what to pass as id to

[Rails] Routes are not available in RSpec integration test

2010-10-03 Thread Paul
My RSpec integration tests do not seem to have access to the rails routes methods. Here's a link to my more descriptive question on stack overflow: http://stackoverflow.com/questions/3847102/routes-are-not-available-in-rspec-integration-test Does anyone know how to fix this? -- You received

[Rails] Routes ordering

2010-08-20 Thread Abder-Rahman Ali
In the Head First Rails book, it mentions this ordering in routes.rb: ActionController: : Routing: : Routes. draw do | map| map. connect ' /ads/new' , : controller=' ads' , : action=' new' map. connect ' /ads/create' , : controller=' ads' , : action=' create' map. connect ' /ads/' , :

Re: [Rails] Routes ordering

2010-08-20 Thread Colin Law
On 20 August 2010 13:23, Abder-Rahman Ali li...@ruby-forum.com wrote: In the Head First Rails book, it mentions this ordering in routes.rb: ActionController: : Routing: : Routes. draw do | map|   map. connect ' /ads/new' , : controller=' ads' , : action=' new'   map. connect ' /ads/create' ,

[Rails] routes fails??? hmm

2010-07-12 Thread David Zhu
I'm getting: rate_vendor_hardware_url failed to generate from {:vendor_id=#Hardware id: 6, name: this is the hardware name, version: this is the version, ETC ETC What is usually wrong when i recieve _url failed to generate? -- You received this message because you are subscribed to the Google

Re: [Rails] routes fails??? hmm

2010-07-12 Thread Philip Hallstrom
On Jul 12, 2010, at 12:56 PM, David Zhu wrote: I'm getting: rate_vendor_hardware_url failed to generate from {:vendor_id=#Hardware id: 6, name: this is the hardware name, version: this is the version, ETC ETC What is usually wrong when i recieve _url failed to generate? Without seeing

[Rails] Routes?

2010-06-02 Thread anon_comp
The images in my program aren't appearing. They're all housed in public/images so I was hoping that I could modify routes.rb to point the program in the right direciton. The page that has the images has the typical image html code: img src=images/barb1.png Now I know that if I add a '/' in

[Rails] Routes :requirments

2010-05-21 Thread Chris Kilmer
I want to set a route :requirements on an array that verifies a particular parameter is included in an array. Something to the effect of: pre atypes = [:culture, :personality, :communication] map.with_options(:path_prefix = ':atype', :requirements = {:atype = atypes.include?(:atype)}) do

Re: [Rails] Routes :requirments

2010-05-21 Thread Philip Hallstrom
On May 21, 2010, at 3:13 PM, Chris Kilmer wrote: I want to set a route :requirements on an array that verifies a particular parameter is included in an array. Something to the effect of: pre atypes = [:culture, :personality, :communication] map.with_options(:path_prefix = ':atype',

[Rails] rails routes and regex

2010-04-12 Thread Me
We have an api set up where the version will change is there a way to map the :controller part to take that part into account and not have to map v1 v2... map.connect 'api/:v/:controller/:action', :controller = 'api/:v/:controller', :v = /v\d+/ Can I use :v in both sections or just the first

[Rails] Routes Link_to

2010-03-08 Thread Greg Ma
Hi, I really don't know if i am doing this correctly, so please tell me if so. I have a product model who has many ingredients. So in my product form i've added a text_field to put the ingredient, and create or find it on the add action. Here is what i've done View: % form_for @product do |f| %

[Rails] Routes and Requirements parameter question

2010-01-26 Thread Cs Webgrl
I have done very little with customizing routes so this is new for me. I would like to send users to my users controller only if it follows a particular pattern. I think that I might be able to use requirements for this? I've got this so far, but it's not quite working. map.user ':user',

[Rails] Routes and permalinks problem

2010-01-25 Thread Cs Webgrl
Hi. I've got a user who wants url's to look like this: www.domain.com/firstname-lastname. Right now I have a route set up like this map.user ':user', :controller = 'user', :action = 'show' This causes problems when I get robots and people searching for urls that don't map to an existing user.

[Rails] Routes with more than 1 param between slashes...

2009-11-16 Thread Wagner
Hello. I am a beginner. I wanna make a route like this: /document-:language-:month-:year.pdf With 3 params, so I can retrieve a PDF in a URL like: /document-english-june-2008.pdf I have 2 problems... 1. It seems I can't put more than 1 param between the slashes The route

[Rails] Rails Routes using complex parameter names

2009-10-10 Thread wbr
I have a search form that generates ugly but functional urls.The controller takes nested parameters from the url like program [program_id], or program[leader][leader_id]. So I'm trying to create a named route to make certain pre-defined searches easier for customers to embed in their own

[Rails] Re: Rails Routes using complex parameter names

2009-10-10 Thread Marnen Laibow-Koser
wbr wrote: I have a search form that generates ugly but functional urls.The controller takes nested parameters from the url like program [program_id], or program[leader][leader_id]. So I'm trying to create a named route to make certain pre-defined searches easier for customers to embed in

[Rails] Re: Rails Routes using complex parameter names

2009-10-10 Thread Matt Jones
On Oct 9, 5:24 pm, wbr banane...@gmail.com wrote: ... and I'm not in a position to change how the controller works or redefine the expected incoming parameters. Thoughts or suggestions or workarounds? Get a new gig. Seriously, any place that ties your hands like this isn't worth putting

  1   2   >