Displaying 20 results from an estimated 50000 matches similar to: "Can I strip a file suffix off a URL with routing?"
2006 Nov 04
0
Question about named routes - getting "No url can be generated for the hash"
So I''ve decided to clean up the structure of my rails app and have
been using named routes and storing certain controllers underneath
other controllers where appropriate.. For example, I have an
AdminController, as well as a ContentController. I decided to make
ContentController a subclass of the AdminController, because the
content management portion of the site is only accessible to
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 =>
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)
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
2007 Feb 21
6
Problem with url_for and https - overrides all options
I have a piece of code like this in one of my views:
<%=link_to "link here", :action=>''my_action'', :id=>1 %>
It works fine on my local development machine, running Webrick over http
and it works fine on my testing server which is running single mongrel
instance behind Apache 1.3 as a proxy. On both the outcome link is this:
<a
2006 Jan 14
3
link_to_remote where the url contain a javascript variable
Ok, so I am basically trying to use ''link_to_remote'' and pass the value
of a javascript variable as an argument. Something like that:
link_to_remote "my_link",
:update => ''my_div'',
:url => { :action => "my_action", :var =>
''my_var'' }
Basically,
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 Aug 07
2
'ldap machine suffix' is ignored?
Hi, all!
I'm using samba-3.0.23 (Revision: 16921, from ports collection, under
FreeBSD 6.1 with OpenLDAP 2.3.24 & smbldap-tools-0.9.2a) as PDC with
following config:
[global]
dos charset = CP1251
unix charset = KOI8-R
workgroup = DOMAIN
server string = Samba Server
password server =
passdb backend = ldapsam
passwd program =
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
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 Aug 10
2
new problem: PDC is not member of own domain? (was: 'ldap machine suffix' is ignored?)
Hi, all!
There is a share on PDC (Samba 3.0.23):
[Soft]
comment = Software
path = /st2/soft
valid users = "@Domain Users"
read only = No
share modes = No
I do:
# cd /st2/soft
# touch testfile
# chown testuser:"Domain Users" testfile
# chmod a+rwx testfile
After logon on windows workstation (domain member) as testuser, I going
to
2011 Nov 17
1
Introducing \n's so that par.strip.text can produce multiline strips in lattice
Dear all,
I have the following data, which has \\n in place of \n. I introduced \n's
in the csv file so that I could use it in barchart in lattice. When I did
that and read it into R using read.csv, it read it as \\n. My question is
how do I introduce "\n" in the middle of a long string of quoted text so
that lattice can make multiline strips. Hitting Enter which is supposed to
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]
2006 May 18
0
QUESTION: Routing system scalability/best practices
Hello,
I was wondering if people have a sense of the performance scalability of
the routing system, in the number of map.connect statements. Is
execution time (or memory usage) of routing any more than linear in the
number of map.connects? I figure I''d ask before trying to
reverse-engineer all the code generation... :)
On a related note, the reason I potentially have a lot of
2007 Apr 01
2
"-" instead of "_" in routes?
Hi all
I''d like to have minus signs "-" instead of underscores "_" in my
routes. Is there an easy to do that?
my_controller/show_something/123 # <= not cool
my-controller/show-something/123 # <= much cooler
Thanks a lot
Josh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2008 Feb 02
3
Question abt redirect_to..
I found a reference to using attachment_fu and followed the lead of it
but having an issue with the redirect_to that renders the fb:render
tag - In my form I''m setting the canvas to false, file is being
uploaded / save fine but when I attempt to redirect:
redirect_to :action => :new, :canvas => true
Unfortunatly it looks like my callback URL is getting printed twice, e.g.
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"
2006 Dec 04
2
background color in strip.custom()
Hi all,
how can I change the background color in lattice strips according to a
factor level, eg:
library(lattice)
x <- rnorm(100)
y <- sqrt(x)
f <- gl(2, 50, c("A", "B"))
xyplot(y ~ x | f)
I like to change the background color of the strips according to the
levels in f and tried several things like this with no success:
xyplot(y ~ x | f,
2009 Sep 19
3
Lattice: combine the same strip?
Hello R helpers,
I am producing a figure with dual strips, i.e., x~y | S1 + S2, where S1 and
S2 are two strips. For example, in figure 2.1 at
http://lmdvr.r-forge.r-project.org/figures/figures.html.
In this case, I would like to combine the the top strip, since all three
pictures in the same row have the same level based on the first strip. In
other words, instead of
| -- S11 -- | -- S11 -- |