Hello RoR Developers I want to create parameter in routes.rb which is wanted to be used in javascript code in view page. there is select object in my view page and this parameter will get value from select object however that my select object is not in form. how can I create parameter in routes.rb and equals to option value. thank you very much for any commend. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can not do that because map.connect is formed like below: map.connect '':any/:thing'', :controller => "report", :action => "access" :filter => :any :thing => ''any option'' ~*~*~*~*~*~*~*~*~*~*~*~*~*~ Reinhart Ariando YM:Booking2Heaven WEB: teapoci.blogspot.com ~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> You can not do that because map.connect is formed like below:> map.connect '':any/:thing'', > :controller => "report", > :action => "access" > :filter => :any > :thing => ''any option''do you have any idea how to do it? I have a sample code of my friend but I didnt understand it well %w( optimize report sheet ).each do |controller| map.connect ":enterprise_code/:m_hierarchy_id/:t_project_id/#{controller}/:action/:id", :controller => "project/#{controller}", :requirements => { :m_hierarchy_id => /\d+/, :t_project_id => /\d+/ } end in routes.rb Actually I could nt understand the logic of parameters in routes. my question was quite silly I think. thank you very much for your commend again. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> %w( optimize report sheet ).each do |controller| > map.connect > ":enterprise_code/:m_hierarchy_id/:t_project_id/#{controller}/:action/:id", > :controller => "project/#{controller}", > :requirements => { :m_hierarchy_id => /\d+/, :t_project_id => > /\d+/ } > end > > in routes.rbif i read this script, it will work. Let me explain your friend script mean off. There will be 3 controllers name, you will run, optimize, report, sheet.> %w( optimize report sheet ).each do |controller| > map.connect > ":enterprise_code/:m_hierarchy_id/:t_project_id/#{controller}/:action/:id"example your enterprise_code params in /project/optimize is ''Voo_doo'', and :t_project_id is ''1'',:m_hierarchy_id is ''2'', :action is ''testing'', :id is ''5'' your url will be http://localhost:3000/voo_doo/02/01/optimize/testing/5 -------------------------------------------------- :requirements => {:name => /reg_exp/..} ------------------------------------------------ specifies that the given components, if present in the URL, must each match the specified ''regular expressions'' in order for the map as a whole to match. In other words, if any component does not match this map will not be used. ------------------------------------------------ :action is where your def method in your controller you want to use ------------------------------------------------ Manual: http://manuals.rubyonrails.com/read/chapter/65 http://api.rubyonrails.org/classes/ActionController/Routing.html Nice to help you ~*~*~*~*~*~*~*~*~*~*~*~*~*~ Reinhart Ariando YM:Booking2Heaven WEB: teapoci.blogspot.com ~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
1 Manual left: http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9060861&source=rss_topic88 -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thank you again and again -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---