Re: [Rails] Re: routes

2017-09-12 Thread Norbert Melzer
On 09/12/2017 11:02 PM, Colin Law wrote: > On 12 September 2017 at 02:15, Joe Guerra wrote: >> ... >> I'm using... in my routes file. >> >> get resources :gallery > Why is the 'get' there? I asked before, but that wasn't heard, perhaps increasing the noise might help?

Re: [Rails] Re: routes

2017-09-12 Thread Joe Guerra
*here's the output of my routes... (sorry about the formatting)* Prefix Verb URI Pattern Controller#Action androids GET/androids(.:format) androids#index POST /androids(.:format)

Re: [Rails] Re: routes

2017-09-12 Thread Colin Law
On 12 September 2017 at 02:15, Joe Guerra wrote: > ... > I'm using... in my routes file. > > get resources :gallery Why is the 'get' there? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe

Re: [Rails] Re: routes

2017-09-12 Thread Joe Guerra
Thanks, I'll add the post the results of my routes tonight. (when I'm at home). On Tue, Sep 12, 2017 at 4:26 PM, Ben Edwards wrote: > +1 > > post output from '$ rails routes', it will really help people help you. > > also 'NoMethodError in Gallery#new sounds like the new

Re: [Rails] Re: routes

2017-09-12 Thread Ben Edwards
+1 post output from '$ rails routes', it will really help people help you. also 'NoMethodError in Gallery#new sounds like the new method is missing from the Gallery controller so posting that would also be good. Ben On Tuesday, September 12, 2017 at 3:23:21 PM UTC+1, Colin Law wrote: > > On

Re: [Rails] Re: routes

2017-09-12 Thread Norbert Melzer
On 09/12/2017 05:22 PM, Joe Guerra wrote: > On Tue, Sep 12, 2017 at 10:21 AM, Colin Law > wrote: > > rails routes > will show you all configured routes, which may help > > yes, I know that.   :) But you did not understand… If you had shown

Re: [Rails] Re: routes

2017-09-12 Thread Joe Guerra
yes, I know that. :) On Tue, Sep 12, 2017 at 10:21 AM, Colin Law wrote: > On 12 September 2017 at 15:15, Joe Guerra wrote: > > RIght, I tried resources galleries, resources gallerys > > > > But all come up with other errors. My post controller and

Re: [Rails] Re: routes

2017-09-12 Thread Colin Law
On 12 September 2017 at 15:15, Joe Guerra wrote: > RIght, I tried resources galleries, resources gallerys > > But all come up with other errors. My post controller and views work, this > gallery controller seems to look the same? (I don't get it). rails routes will show

Re: [Rails] Re: routes

2017-09-12 Thread Joe Guerra
Doesn't running the scaffold command put the route in the routes file for you? On Tuesday, September 12, 2017 at 10:15:07 AM UTC-4, Joe Guerra wrote: > > RIght, I tried resources galleries, resources gallerys > > But all come up with other errors. My post controller and views work, > this

Re: [Rails] Re: routes

2017-09-12 Thread Joe Guerra
RIght, I tried resources galleries, resources gallerys But all come up with other errors. My post controller and views work, this gallery controller seems to look the same? (I don't get it). Thanks, Joe On Tuesday, September 12, 2017 at 3:45:29 AM UTC-4, Norbert Melzer wrote: > > Am

Re: [Rails] Re: routes

2017-09-12 Thread Norbert Melzer
Am 12.09.2017 um 03:15 schrieb Joe Guerra: > get resources :gallery You do have this in your routesfile literally? Seems invalid for me. Also As far as I can remember the convention, `resources` needs the plural name, not the singular name. But I haven't used rails since about 3.x-ish. -- You

Re: [Rails] Re: routes

2017-09-11 Thread Joe Guerra
ok, it looks like my other form <%= simple_form_for @gallery do |f| %> <% if @gallery.errors.any? %> <%= "#{pluralize(@gallery.errors.count, "error")} prohibited this image from being saved:" %> <%

Re: [Rails] Re: routes

2017-09-11 Thread Ben Edwards
Ineptitude;): Should be http://guides.rubyonrails.org/routing.html. Ben On Monday, September 11, 2017 at 6:33:09 PM UTC+1, Hassan Schroeder wrote: > > On Mon, Sep 11, 2017 at 10:16 AM, Ben Edwards > wrote: > > > http://guides.rubyonrails.org/v3.1.3/routing.html may

Re: [Rails] Re: routes

2017-09-11 Thread Hassan Schroeder
On Mon, Sep 11, 2017 at 10:16 AM, Ben Edwards wrote: > http://guides.rubyonrails.org/v3.1.3/routing.html may help. Uh, any particular reason to post a link to a guide for a version of Rails that's been unsupported for a very long time? -- Hassan Schroeder

[Rails] Re: routes

2017-09-11 Thread Ben Edwards
As Nobert says they are independent. Post your routes.rb, where the view is you want the route to go to and say what you were expecting. http://guides.rubyonrails.org/v3.1.3/routing.html may help. Also if you have not done so do the Getting started guide on the rails website. See it

[Rails] Re: routes for devise in rails4

2013-07-09 Thread mack gille
Thomas Chik wrote in post #1114847: How about an authorization solution like cancan. Have a single sign in point and redirects based on user rights. ya,but my sign in page should has the fields like username: password: rememberme signin so how can -- Posted

[Rails] Re: routes for devise in rails4

2013-07-09 Thread mack gille
mack gille wrote in post #1114848: Thomas Chik wrote in post #1114847: How about an authorization solution like cancan. Have a single sign in point and redirects based on user rights. ya,but my sign in page should has the fields like username: password: rememberme

[Rails] Re: routes for new resources

2012-08-18 Thread bertly_the_coder
Hey John, Haven't you defined it as a POST in this line? post :preview On Friday, August 17, 2012 6:38:38 PM UTC+3, John Merlino wrote: actually, let me rephrase this. That route points to the preview action of a reports controller, but why is it a POST for a new resource? On Aug 17,

[Rails] Re: routes for new resources

2012-08-17 Thread John Merlino
actually, let me rephrase this. That route points to the preview action of a reports controller, but why is it a POST for a new resource? On Aug 17, 11:32 am, John Merlino stoici...@aol.com wrote: Does anyone know what the controller code would look like for a route like this: resources

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

2012-06-25 Thread drrs
Can someone confirm if this is a correct statement otherwise? On Saturday, June 23, 2012 7:12:51 PM UTC-5, drrs wrote: 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. --

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

2012-06-25 Thread drrs
This commit in Rails git source explains it pretty much: commit 48bf667a8b1c489bd6edff0b8322324a7a1b06bc Author: José Valim Date: Thu Sep 2 12:54:16 2010 +0200 Ensure routes are loaded only after the initialization process finishes, ensuring all configuration options were applied. On

[Rails] Re: routes ressources and namespace

2012-05-17 Thread angel david
Hi Greg, Its one of the way to change the name space. Regarding the error: Categories controller might have been under admin module. If you check app/controllers/admin, you will c categories controller. The routes - match 'categories/:name' = 'admin/categories#show', :as = :category goes to

Re: [Rails] Re: routes ressources and namespace

2012-05-17 Thread Greg
Hi Angel, you are right the error occurs because my categories controller is under admin/categories_controller. Now the error makes sense. Regards the configuration of my route. I think I will leave it as it is because it's working how I expect it. Cheers Greg Am 17.05.2012 um 13:41

[Rails] Re: routes issues with rails3

2012-02-29 Thread Xuan
You should define it as :on = :collection Problem is you defined it as :member, so it expects an id to be passed, so the expected url would look like /home/:id/login Hope this helps! On 29 feb, 15:14, amvis vgrkrish...@gmail.com wrote: Here i am using *rails3*, here the view.html.erb form

[Rails] Re: routes problem

2011-12-01 Thread Frederick Cheung
On Dec 1, 11:28 am, Vogon Primo li...@ruby-forum.com wrote: 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,

[Rails] Re: routes problem

2011-12-01 Thread Vogon Primo
Frederick Cheung wrote in post #1034554: On Dec 1, 11:28am, Vogon Primo li...@ruby-forum.com wrote: POST /projects/:project_id/tickets(.:format) It invokes the show action and not the index action. Why? It's also doing weird stuff because it hasn't picked a project_id from the url

Re: [Rails] Re: routes problem

2011-12-01 Thread thiagocifani
in your path are you sending the project object as params? 2011/12/1 Vogon Primo li...@ruby-forum.com Frederick Cheung wrote in post #1034554: On Dec 1, 11:28am, Vogon Primo li...@ruby-forum.com wrote: POST /projects/:project_id/tickets(.:format) It invokes the show action and

[Rails] Re: routes problem

2011-12-01 Thread Vogon Primo
Vogon Primo wrote in post #1034547: 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}

[Rails] Re: routes question

2011-08-12 Thread 7stud --
Thanks! -- 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 email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Routes - Search url parser

2011-05-11 Thread danimashu
I would advise against a strategy that could ever be ambiguous, even if it looks unlikely at the moment.  It would likely bite you at some point in the future, or even worse the developer who comes hereafter, can you imagine what he/she would say about you when he realised the problem and

[Rails] Re: Routes - Search url parser

2011-05-10 Thread danimashu
Thanks for the answer. But then what happens with:  - example.com/pink/cadillac  ? In the controller would have to check that pink is a Color and cadillac is a Brand. Problem if some day there is a Brand with name of Color. I don't know if it's worth wasting time on it. The classic way sould

Re: [Rails] Re: Routes - Search url parser

2011-05-10 Thread Colin Law
On 10 May 2011 11:32, danimashu daniel.madrid.re...@gmail.com wrote: Thanks for the answer. But then what happens with:  - example.com/pink/cadillac  ? In the controller would have to check that pink is a Color and cadillac is a Brand. Problem if some day there is a Brand with name of

[Rails] Re: Routes - Search url parser

2011-05-09 Thread danimashu
Any help? -- 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-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more

[Rails] Re: Routes - Search url parser

2011-05-09 Thread Ar Chron
danimashu wrote in post #997411: I would prefer to have a url like that: - example.com/ford/red But then what happens with: - example.com/pink/cadillac ? I'd be careful of investing any particular logic behind your urls for dealing with arguments. Do all your users catagorize things the

[Rails] Re: Routes - Search url parser

2011-05-08 Thread danimashu
For give a example, the url I hope to have is something like that: - example.com/brand/ford/color/red - example.com/brand/ford - example.com/color/red The idea is to have the same that: - example.com/cars?brand=fordcolor=red But really, the user already knows that Ford is a brand and Red is a

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

2011-04-18 Thread sol.manager
Google doesn't seem to want to post my reply properly. I wanted to say thank you as your last suggestion worked. I removed the offending = and my site is working with Solr properly now. Thank you. On Apr 17, 6:05 pm, Phil Crissman phil.criss...@gmail.com wrote: On Sun, Apr 17, 2011 at 4:17 PM,

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

2011-04-17 Thread sol.manager
On Apr 16, 11:58 pm, Phil Crissman phil.criss...@gmail.com wrote: Phil I tried this and it isn't working out. I have a job model. In the views/jobs/index.html.erb file I have the following at the top. h1Listing jobs/h1 %= form_tag search_jobs_path, :method = :get do % p %= text_field_tag

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

2011-04-17 Thread Phil Crissman
On Sun, Apr 17, 2011 at 12:59 PM, sol.manager sol.mana...@gmail.com wrote: On Apr 16, 11:58 pm, Phil Crissman phil.criss...@gmail.com wrote: Phil I tried this and it isn't working out. I have a job model. In the views/jobs/index.html.erb file I have the following at the top. h1Listing

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

2011-04-17 Thread sol.manager
The full error message goes something like this: showing app/views/jobs/_search_form.html.erb where line #1 raised: compile error /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ _search_form.html.erb:1: syntax error, unexpected ')' ...obs_path, :method = :get do ).to_s); @output_buffer.concat

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

2011-04-17 Thread Phil Crissman
On Sun, Apr 17, 2011 at 4:17 PM, sol.manager sol.mana...@gmail.com wrote: The full error message goes something like this: showing app/views/jobs/_search_form.html.erb where line #1 raised: compile error /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ _search_form.html.erb:1: syntax

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

2011-04-17 Thread sol.manager
This totally fixed the problem and my app is now properly doing Solr full text searches of my jobs model. Thank you for the assistance. Problem is not the route, then. This line (above) should not have an '=' sign at the beginning. Try % form_tag search_jobs_path, :method = :get do % 2:

[Rails] Re: Routes and REST Issue

2011-03-29 Thread Peter Laurens
Frederick Cheung wrote in post #989738: On 28 Mar 2011, at 22:52, Peter Laurens li...@ruby-forum.com wrote: describe PUT 'new' do response.should_not be_success :password=a_password, :controller=sessions, :action=new} So clearly I've made an error here somewhere with my Routes, can

[Rails] Re: Routes - Making Delete a Collection Operation

2011-03-20 Thread Markus Proske
Hi, a collection routes is meant to work on the whole collection. Example for a collection delete would be for example to delete all books that are out of print. If you want to delete a particular book the member route is perfecthow would you otherwise know in your controller, which book

[Rails] Re: Routes - Making Delete a Collection Operation

2011-03-20 Thread Peter Laurens
Hi Markus, I think I haven't been clear enough, the default resource is set up for individual members, rake routes gives me this: ... DELETE /appearances/:id(.:format) ... Whereas I actually want to create a route for deleting a collection: ... DELETE /appearances ... But I don't believe this

Re: [Rails] Re: Routes - Making Delete a Collection Operation

2011-03-20 Thread Colin Law
On 20 March 2011 17:12, Peter Laurens li...@ruby-forum.com wrote: Hi Markus, I think I haven't been clear enough, the default resource is set up for individual members, rake routes gives me this: ... DELETE /appearances/:id(.:format) ... Whereas I actually want to create a route for

[Rails] Re: Routes - Making Delete a Collection Operation

2011-03-20 Thread Markus Proske
Well, you can prevent Rails from creating that route for you using :except or :only in the routes.rb and then add a collection route with the same name (if you need examples on that, you can follow the link in my signature). Technically that solves your problem. But this is for removing a

[Rails] Re: Routes not working

2011-01-19 Thread jgwmaxwell
Try doing this instead, and see if this helps: form_for User.new -- 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-talk@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Routes not working

2011-01-19 Thread Jeff Miller
John Maxwell wrote in post #976103: Try doing this instead, and see if this helps: form_for User.new Thanks for the suggestion, unfortunately that doesn't work either - it gives me a NoMethodError... I just figured it out - I added a line in my routes.rb under 'get user/register' that reads

[Rails] Re: Routes problem in form

2011-01-09 Thread Frederick Cheung
On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: 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. Do you want admin_carriers_path? You can probably simplify things

[Rails] Re: Routes problem in form

2011-01-09 Thread JD
Well I've figured this one out so no worries. On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: 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

[Rails] Re: Routes problem in form

2011-01-09 Thread JD
On Jan 9, 6:14 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: 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

[Rails] Re: Routes problem in form

2011-01-09 Thread rwz
yes, it will work On Jan 10, 1:34 am, JD jdg@gmail.com wrote: On Jan 9, 6:14 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: Hello all, I'm relatively new to rails and have been doing ok with it but I have run into an issue

[Rails] Re: routes friendly URL's

2010-11-30 Thread Marnen Laibow-Koser
andyl wrote in post #965181: 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

[Rails] Re: Routes Id issue in 2.3.5

2010-10-08 Thread Marnen Laibow-Koser
The_programmer wrote: 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. Your question appears to make little sense as stated. Try again with more information: * What are you trying to achieve? *

Re: [Rails] Re: Routes Id issue in 2.3.5

2010-10-08 Thread ryan satterfield
Thank you for the reply Marnen. Yes, the rdoc for routes 2.3.5 would be very helpful. I am trying to make my Routes allow multiple doctors to have accounts. Since I won't know what Doctor is logging in, I am not sure what to give as the id. This is the relevant piece of my routes. map.resources

[Rails] Re: Routes ordering

2010-08-20 Thread Parker Selbert
Abder-Rahman Ali 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' , : controller=' ads' , : action=' create'

[Rails] Re: Routes ordering

2010-08-20 Thread Marnen Laibow-Koser
Abder-Rahman Ali 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' , : controller=' ads' , : action=' create'

[Rails] Re: Routes ordering

2010-08-20 Thread Abder-Rahman Ali
Thanks everyone. Yes, Parker, the Head First Rails is 2008. -- 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 email to rubyonrails-t...@googlegroups.com. To unsubscribe

[Rails] Re: routes fails??? hmm

2010-07-12 Thread Marnen Laibow-Koser
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? You're not providing the right parameters to

[Rails] Re: Routes?

2010-06-03 Thread anon_comp
On Jun 3, 12:48 am, Arun Srini arunro...@gmail.com wrote: Can you share how you solved it? Am facing a similar situation. Sure thing. This may or may not be your situation considering that my page was an outside-program-generated .html page. If it is then all you have to do is move the page to

[Rails] Re: Routes?

2010-06-03 Thread Sharagoz
On Jun 2, 8:31 pm, anon_comp neocools...@gmail.com wrote: I know squat about routes despite reading Agile Web Development with Rails, two other relatively thick books, and multiple articles on the web. I've tried many different ways to define the routes in hopes of stumbling on the answer

[Rails] Re: Routes?

2010-06-03 Thread anon_comp
On Jun 3, 9:14 am, Sharagoz shara...@gmail.com wrote: Doesn't %= image_tag('some_image.png') % always produce an image tag pointing to /images/some_image.png regardless of which view it is being called from? Yes it does, but read the paragraphs before that to see that the rendered page uses a

[Rails] Re: Routes?

2010-06-03 Thread Sharagoz
On Jun 3, 5:40 pm, anon_comp neocools...@gmail.com wrote: On Jun 3, 9:14 am, Sharagoz shara...@gmail.com wrote: Yes it does, but read the paragraphs before that to see that the rendered page uses a normal html img call and that it occurs about 100 times. But your suggestion is completely

[Rails] Re: Routes?

2010-06-03 Thread anon_comp
On Jun 3, 11:54 am, Sharagoz shara...@gmail.com wrote: So you're saying that you don't have control over the image tags that are being generated in your views? That sounds like a bad position to be in. I have no idea how you would go about manipulating the routing to redirect calls to image

[Rails] Re: Routes?

2010-06-02 Thread anon_comp
On Jun 2, 2:31 pm, anon_comp neocools...@gmail.com wrote: 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:

[Rails] Re: Routes?

2010-06-02 Thread Arun Srini
Can you share how you solved it? Am facing a similar situation. On Jun 3, 1:11 am, anon_comp neocools...@gmail.com wrote: On Jun 2, 2:31 pm, anon_comp neocools...@gmail.com wrote: The images in my program aren't appearing. They're all housed in public/images so I was hoping that I could

[Rails] Re: Routes and permalinks problem

2010-01-25 Thread Me
The book shows to do a catch-all route at the bottom of the route file. map.connect '*path', :controller = 'foo'. The *path will put the values in an array 'path'. On Jan 25, 11:09 am, Cs Webgrl li...@ruby-forum.com wrote: Hi. I've got a user who wants url's to look like

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

2009-11-17 Thread corntrace
You can try friendly_id http://github.com/norman/friendly_id On Nov 16, 8:24 am, Wagner wag...@myrango.com wrote: 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:

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

2009-11-16 Thread Rick DeNatale
On Sun, Nov 15, 2009 at 7:24 PM, Wagner wag...@myrango.com wrote: 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

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

2009-11-16 Thread eugenio
if the only thing you need is a nicer url you can override the to_params method in the model. something like: def to_params #{id}-#{language}-#{year}-#{month} end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby

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

2009-11-16 Thread Wagner
I tried this. It works but only with underscores, but it doesn't work with -. On Nov 16, 12:22 pm, Rick DeNatale rick.denat...@gmail.com wrote: On Sun, Nov 15, 2009 at 7:24 PM, Wagner wag...@myrango.com wrote: Hello. I am a beginner. I wanna make a route like this:

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

2009-11-16 Thread eugenio
it should, i used something like that (i mean with '-') did you keep the numeric id at the beginning of the to_params? you can search for Document.find(params[:id]) at usual because params [:id] is passed through to_i 43-en-2008-04.pdf.to_i == 43 On 16 Nov, 21:08, Wagner wag...@myrango.com

[Rails] Re: routes: _path vs. _url

2009-10-07 Thread Philip Hallstrom
Routes offers you the ability to use _path or _url as a way to make links/redirect/etc throughout your site. However, I'm just wondering when you should use _path and when you should use _url. Is there a preference to which one to use? They seem to be fairly interchangeable (in my very

[Rails] Re: routes configuration

2009-10-06 Thread Matt Jones
See http://api.rubyonrails.org/classes/ActionController/Routing.html - in particular, the section on route globbing. --Matt Jones On Oct 5, 10:05 am, Muruga Raj rails-mailing-l...@andreas-s.net wrote: Hello all, I need a suggestion in routes configuration. My requirement is to get all the

[Rails] Re: routes configuration

2009-10-06 Thread Muruga Raj
Matt Jones wrote: See http://api.rubyonrails.org/classes/ActionController/Routing.html - in particular, the section on route globbing. --Matt Jones On Oct 5, 10:05�am, Muruga Raj rails-mailing-l...@andreas-s.net Thank you very much Jones. That's what i expected. I added the following

[Rails] Re: Routes requirements exclude one character

2009-09-24 Thread Harm
That _is_ clever! I still believe Rails is in error here. The docs indeed do suggest that the stuff is anchored. Clearly it's not. I'll consider making a ticket. Thanks for the input guys! On Sep 23, 10:30 pm, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net wrote: Matt Jones wrote:

[Rails] Re: Routes requirements exclude one character

2009-09-23 Thread Matt Jones
The regexp you've specified here will match as long as there are at least two consecutive non-space characters. The only way I can think of to do what you're looking for would be to add a route preceding this one which matches any :plan WITH a space, and routes it to an error page. EG:

[Rails] Re: Routes requirements exclude one character

2009-09-23 Thread Marnen Laibow-Koser
Matt Jones wrote: The regexp you've specified here will match as long as there are at least two consecutive non-space characters. I would have thought so, but the routing docs suggest that the regex is implicitly anchored at both ends (look at the postalcode example). The only way I can

[Rails] Re: Routes and urls: www.example.com

2009-09-21 Thread Richard Schneeman
That Worked!! Now it looks even better than it did before, I can go to /widget/show/www.example.com without that nasty ?url= . Good Work!! I also have to admit that i should have RTFM http://guides.rubyonrails.org/routing.html mentions this technique, apparently its called Route Globbing and

[Rails] Re: Routes and urls: www.example.com

2009-09-20 Thread Matt Jones
You might want to try: map.widget '/widget/show/*url', :controller = 'widget', :action = 'show' and see if that works. I seem to recall that the dots are the issue, as the router typically uses them to separate formats from request params. --Matt Jones On Sep 19, 11:04 pm, Richard Schneeman

[Rails] Re: Routes With Same URL Mapped To Different Actions

2009-09-09 Thread Rob Biedenharn
On Sep 9, 2009, at 7:06 PM, MaggotChild wrote: Can't find the answer to this. My old message received no responses (subject was messed up). Is it possible to create routes that have the same URL yet map to a different action based on the HTTP method (or pseudo method) like a Rails'

[Rails] Re: Routes problem

2009-08-29 Thread Matt Jones
On Aug 28, 2:43 pm, Himanshu Prakash vision2...@gmail.com wrote: Hi John, try this approach: in the Product class add this function- require 'uri'   def self.find_custom arg     object = self.new     object.id = URI.escape(arg)     object   end and in the controller try calling as:

[Rails] Re: Routes problem

2009-08-29 Thread Rob Biedenharn
On Aug 28, 2009, at 2:02 PM, John Mcleod wrote: Since I've been learning rails, I thought that routes are the linking of the Controller Object to their Action method. When you set up RESTful routing, you need to add custom or named routes after the default 7. To set up custom or named

[Rails] Re: Routes problem

2009-08-28 Thread Rob Biedenharn
On Aug 28, 2009, at 11:34 AM, John Mcleod wrote: Hello all, Here's a newbie question (4 weeks and counting). My routes.rb is as below. map .resources :projects, :departments, :users, :admins, :imports, :notes #Below is route in question map.resources :projects, :collection = { :view_all

[Rails] Re: Routes problem

2009-08-28 Thread John Mcleod
Since I've been learning rails, I thought that routes are the linking of the Controller Object to their Action method. When you set up RESTful routing, you need to add custom or named routes after the default 7. To set up custom or named routes, you use map.connect path/to/view, :controller =

[Rails] Re: Routes problem

2009-08-28 Thread Himanshu Prakash
Hi John, try this approach: in the Product class add this function- require 'uri' def self.find_custom arg object = self.new object.id = URI.escape(arg) object end and in the controller try calling as: Product.find_custom(params[:id]).view_all just try it, and let me know. On

[Rails] Re: Routes problem

2009-08-28 Thread James Englert
ROR will attempt to find routes from the top of the file first and then move on to the rest of the file. It would seem that you have listed projects twice: map.resources :*projects*, :departments, :users, :admins, :imports, :notes #Below is route in question map.resources :*projects*,

[Rails] Re: Routes problem

2009-08-28 Thread Ar Chron
John Mcleod wrote: Hello all, Here's a newbie question (4 weeks and counting). My routes.rb is as below. map.resources :projects, :departments, :users, :admins, :imports, :notes #Below is route in question map.resources :projects, :collection = { :view_all = :get } map.home '',

[Rails] Re: Routes problem

2009-08-28 Thread E. Litwin
Another tip is to run rake routes to see all the available routes. On Aug 28, 9:26 am, James Englert englert.ja...@gmail.com wrote: ROR will attempt to find routes from the top of the file first and then move on to the rest of the file. It would seem that you have listed projects twice:

[Rails] Re: Routes and RJS

2009-08-11 Thread bill walton
Hi Pete, On Tue, 2009-08-11 at 17:20 +0200, Pete Moran wrote: Hi Folks, Sorry to ask more questions :) So I gave a RJS a go, I have a simple countries 'index' which lists countries and with alink to 'show' which shows detail. Assuming you're using link_to_remote, you can change the HTTP

[Rails] Re: Routes, sqlite3

2009-07-31 Thread Protos Jack
Thanks, but, about the first topic? -- 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 email to

[Rails] Re: Routes, sqlite3

2009-07-31 Thread Protos Jack
Protos Jack wrote: Thanks, but, about the first topic? Sorry, I meant second -- 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

[Rails] Re: Routes, sqlite3

2009-07-30 Thread Marnen Laibow-Koser
Protos Jack wrote: [...] First, I would like to delete a table of sqlite3. The problem is that I had a table cathegories created, but I delete the code. Now I created a new model cathegories and when I do the rake, it says I already have the table cathegories created but I cannot use it I

[Rails] Re: Routes from raw js (using XMLHttpRequest)

2009-07-28 Thread Matt Jones
You'll need to grab the token on the server side - see line 1065 of prototype_helper.rb for more detail. But before you do that, you may want to take a look at the rest of PrototypeHelper; what you're doing looks to be well-covered by the methods already available, which could save you a lot of

[Rails] Re: Routes from raw js (using XMLHttpRequest)

2009-07-27 Thread JannaB
Oh, wait, I need to pass the parameter of the authenticity_token to the url. How can I do this? --~--~-~--~~~---~--~~ 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

[Rails] Re: Routes from raw js (using XMLHttpRequest)

2009-07-25 Thread Matt Jones
What shows up in the log when you try this action? That will give you more info... --Matt Jones On Jul 24, 8:09 am, JannaB mistressja...@hotmail.com wrote: I am making an ajax call from js to call a method (assocboxchange) in my controller (AssociatesController),  using XMLHttpRequest. I know

[Rails] Re: Routes from raw js (using XMLHttpRequest)

2009-07-25 Thread JannaB
What a great tool. When I click the select box, in firebug, I see a RED: POST http://localhost:3000/channels/assocboxchange/ with a littel red circle with a white X in it. IF I look at the parameters, those seem to be passed properly. In my ChannelsController, I have: def assocboxchange

[Rails] Re: Routes from raw js (using XMLHttpRequest)

2009-07-24 Thread bill walton
On Fri, 2009-07-24 at 05:09 -0700, JannaB wrote: it is posting somewhere and I believe that because in firefox, the error concole is clean. The console tab in the Firebug plugin is what you want to be looking at. It will tell you if / where your app is making requests and the parameters

[Rails] Re: Routes or .htaccess

2009-07-21 Thread Bill McGuire
Gustav Paul wrote: The .htaccess file in your public directory has the following lines which you should uncomment / modify as required: # If your Rails application is accessed via an Alias directive, # then you MUST also set the RewriteBase in this htaccess file. # # Example: # Alias

[Rails] Re: Routes - Preventing a Match

2009-06-06 Thread djolley
If you are wanting Rails to stop processing, what should it do? What are you really wanting to achieve? I just want the URL to be served-up as a static page. The normal use case is that static files are not served by Rails but in that circumstance, another server would serve them *before*

  1   2   >