similar to: "-" instead of "_" in routes?

Displaying 20 results from an estimated 3000 matches similar to: ""-" instead of "_" in routes?"

2006 Apr 27
6
Possible to use dashes instead of underscores in rails?
Hi all - My boss is asking me if we can have dashes instead of underscores in the URL for SEO reasons. Apparently google prefers "foo-bar" to "foo_bar". The former will be found when searching for just "foo", but not the latter. So, I''m wondering if there is a way without changing any of my code if I can tell rails to use dashes instead of underscores?
2006 Jan 16
3
routing to controller inside module
Hey, am i to stupid to find the information about how to route to a controller in a module? Maybe module support has gone! The controller is under: app/controllers/admin/my_controller.rb The my_controller.rb file looks like this: module Admin class MyController def index render :text => ''Hello!'' end end end How does a route to all controllers under module
2006 May 11
1
skipping filters
I have a simple login scheme in application.rb. Something like :requires_login is called in any controller as a before_filter. All is good, except I''m having trouble figuring out how to make the public login actions skip this before filter. Here''s what I have: application.rb skip_before_filter :requires_login, :only => [:login, :logout, :confirm_valid_login]
2007 Nov 16
3
Route Information
Is there a method to return a hash of the route configuration based on a path? For example: magic_method(''/my_controller/my_action/my_id'') => {:controller => ''my_controller'', :action => ''my_action'', :id => ''my_id''} Thanks! Tom --~--~---------~--~----~------------~-------~--~----~ You received this message
2006 May 09
1
Reusing a model to form and link_to.
Hy guys, Inside my app I have a form which contains user information. Sometimes a have a form with a text_field as above: <%= form_remote_tag(:html => { :action => url_for(:controller => "my_controller", :action => "my_action") }) %> <%= text_field(''my_object'', ''my_parameter'', :maxlength =>
2006 Aug 10
1
Web service SOAP URLs started failing with 1.1.4 or using 1.1.2 security patch
Railers, I''m trying to figure out why invocations to my Web service URLs work with Rails 1.1.2 but fail both with Rails 1.1.4 (and 1.1.5) and when I apply the new 1.1.2 security patch to Rails 1.1.2. It looks like they are failing with SOAP clients but succeeding with XML-RPC clients. The URL that used to work is of the form http://localhost:3000/my_controller/ServiceName/api. When I
2005 Dec 18
2
Default routes for unknown actions
Hi folks- I have the following map for default ''junk'' routes: map.connect ''*anything'', :controller => ''welcome'', :action => ''unknown'' Which works just fine for a URL like: "mysite.com/junkjunkjunk" However, it still tries to resolve an action when I do: "mysite.com/my_controller/junkjunkjunk"
2010 Jan 31
3
Append/Prepend to a template from controller method
I want a method in app/controllers/application.rb that can prepend/append text to whatever template gets rendered. Of course I can''t call render twice w/o getting a double render error, so is this possible? I want to redirect after a delay using a meta refresh. Here''s what I''ve got: app/controllers/application_controller.rb: def redirect_after_delay (url, delay)
2006 Jul 28
2
Scaffold and Undercores in Tablenames
I am attempting to generate scaffolds on legacy tables that have underscores in the name. Scaffold does not see the underscore. I have tried a backslash escape but it no work. I have looked around but i cannot find a way to make it work. It''s like this: c:\railroad>ruby script/generate scaffold FOO_BAR exists app/controllers/ exists app/helpers/ create
2006 Apr 08
2
Cannot use view helpers in RJS helpers
Any ideas why I would get an error in a RJS helper on view helpers such as number_to_currency. Example: # my_template.rjs page.help_me # my_helper for my_controller def help_me number_to_currency(10) end I have also tired page.number_to_currency but that doesn''t work either. Cheers, Nicholas
2007 Feb 15
2
underscores ($name_$foo) in string assignments
Hello In a component, I was trying to do: $bar = "lets make a new string with $name_$foo in it." however the "$name_" fails to appear in the resulting string: "lets make a new string with valueOfFoo in it." Is there something special about $name_ here? If I replace the underscore with a dash (... $name-$foo ... ) it works fine. thanks Jesse Jesse
2006 Dec 29
4
Remote API passing in parameter named 'action', routing loses it
I''m working with a remote API that calls a URL in my app, passing in a parameter named action. So the request would look like: http://localhost/my_controller?action=foo Routing correctly interprets the controller action as index. However, it sets params[:action] to index as well. I know that''s how it''s supposed to work...but it means I lose the action parameter
2006 Apr 05
4
Why does titleize remove hyphens?
item.title = ''alpha-bravo'' item.title = item.title.titleize puts item.title alpha bravo I didn''t notice this with 1.0 - a new bug in 1.1? Joe -- Posted via http://www.ruby-forum.com/.
2010 Jun 03
7
Scheduled tasks in Rails: Cron + wget = Best solution?
Hi there, do you agree that for having scheduled tasks in Rails, the leanest solution is the following? - Create a controller with an action for each task - Implement the logic of the task as controller code - Set up a cron job at the OS level that uses wget to invoke the URL of this controller/action at the appropriate time intervals Advantages: 1) full access to all your Rails objects just as
2006 Aug 15
2
to_xml and underscores
hi, i am looking for a solution whereupon calling myEntityObject.to_xml does not convert my attributes containing underscores into hyphens. at the moment an attribute named "my_own_attribute" is converted into <my-own-attribute>. does anybody have an idea how to change that and have to_xml generate <my_own_attribute> thanks ciao robertj -- Posted via
2006 Apr 28
10
Sharing RJS Templates
Hello All, I''m enjoying the simplicity and power of RJS templates in Rails 1.1, but am perplexed about sharing them. I have several templates that I would like to access in various controllers, but if I moved them to views/shared/whatever.rjs, my app can''t seem to find them. I changed the name to _whatever.rjs and referenced them as "shared/whatever", but no luck.
2013 Apr 16
1
Regarding : ATI video driver problems
I gather from the discussion on the reference thread that I'll be having quite a time with a MB having an Integrated ATI Radeon HD 3000 graphics chip set and a video card using a Radeon HD 6570 chip set when I try to run CentOS 6.4 on it. I was going to ask if CrossFire works with CentOS, but it appears that the integrated chip set isn't going to work at all. Well, ignoring all that,
2006 Jul 19
1
A couple of problems
Hi Ezra, Thanks for the great work on BackgrounDRb. I have come across a couple of problems. 1. I wanted to define a simple class in the worker file to wrap up and pass back some data to my controller. It seems that if I create the class either inside or outside of my worker class (in the same file) it gets wrapper by a DRb::DRbUknown object and therefore cannot be accessed from my controller.
2018 Apr 25
2
Bug in RScript.exe for 3.5.0
Hi R Developers, I have found what I think is a bug in the RScript.exe in version 3.5.0 of R for Windows. When I call Rscript.exe for Version 3.5 of R, it is unable to open the file if the file name or path has a space in it. As an example of what happens, I saved 2 files with the code: cat("What do you get when you multiply 6 * 9?") as C:\foo bar.R and as C:\foo_bar.R When I in a DOS
2006 Apr 14
4
Newbie needing help! How to read from database?
I''ve read through all the articles online but most/all of it discusses the use of Scaffolding as a quick solution for reading/writing to a database. I follow all that but now I''m trying to simply get a field from a table in the database to display in my .rhtml files. I''ve been trying to figure this out but to no avail. Someone please help! Thanks. Tim -- Posted