Displaying 20 results from an estimated 10000 matches similar to: "redirect_to or link_to mapped url. any other way than "../../smth"?"
2006 Apr 12
6
distinguishing mapped urls from ordinary action urls
I want to present different view depending on the url.
example below:
http://myapp/start/show?url=xZq
http://myapp/xZq
both addresses are controlled by a single controller and the same action.
the second url is only mapped in routes.rb
how can I distinguished the mapped url and present a slightly different view
in it?
Sabon
-------------- next part --------------
An HTML attachment was
2006 Apr 13
0
keep getting undefined method `rewrite'' error for mapped urls
Hi all,
I''ve checked numerous manuals but can''t find the answer anyway.
in my routes.rb file I have a mapping which maps http://app/start/show/url
to http://app/url
everything works fine BUT:
- when I want to use link_to, redirect_to (smth)
- when I try to even enter <%= form_tag :action =>
''some_other_action_from_the same_controller'' %>
I keep
2006 Apr 20
0
link_to mapped urls
Hi all,
I want my link_to links direct to my mapped urls, not the long ones with
controllers and actions in them.
What I have:
in view:
<%= link_to "random url", random_url %>
routes.rb:
map.random ''random'', :controller => ''start'', :action => ''random''
link_to results in "http://localhost:3001/start/random"
2006 Apr 27
0
redirect_to is changing my webpage charset
Gents,
I just figured out that redirect_to do something with the HTTP headers.
Specially the Content-type and charset.
I mean:
I got diferent encodings (charsets) if I use
http://myapp.com/welcome/index or http://myapp.com/welcome/
Can anyone tell me how can I solve that?
[]s
Manoel Lemos
--
Posted via http://www.ruby-forum.com/.
2006 Mar 31
1
url_for leave out ''index'' action
I''m trying to reduce the size of urls in my app and i was wondering how i
can get all links to an index action to leave out the ''index''. In my
routes.rb, i have it setup to recognize the controller and default to the
index action.
But is there a way to make it so that the ''index'' portion in the url is not
shown to the user? This is mostly a concern
2006 Mar 30
4
redirect_to("url") with post?
Is there a Rails-friendly way to redirect_to an url and post some
parameters with that?
I''ve tried:
redirect_to("http://whatever.com", { ''postme'' => ''this'' })
redirect_to("http://whatever.com", :post => { ''postme'' => ''this'' })
redirect_to("http://whatever.com", :options
2006 Jul 03
0
REST vs. render vs. redirect_to w.r.t. create error messages, efficiency and the desired URL
Hi,
Something has been bothering me for a long time and I''d like to know
what other think about this common situation with Rails.
Someone is looking at http://example.com/user/new where there is a
form that POSTs the data to the user/create action. The controller
might look like
def new
@user = User.new
end
def create
@user = User.new(params[:entry])
if @user.save
2006 Mar 13
1
issue with redirect_to
Hi all:
I can''t make redirect_to to unlock the current iframe using {:TARGET =>
"_top"}. It always stays in the current frame. I checked the
redirect_to code, it seems the method does not use "target". here is the
source code of redirect_to from ActionController::Base
def redirect_to(options = {}, *parameters_for_method_reference) #:doc:
753: case options
2006 Mar 09
3
redirect_to :back question
Hi!
How to use this? I can declare it only inside a controller, so i tried
to do add this to application controller:
def back
redirect_to :back
end
so i could call in all my views
link_to ''back'', :controller => ''application'', :action => ''back''
but it doesn''t work - there are no errors, but i''m still on the same
2006 Jul 26
5
Mongrel + mod_proxy URL issues
We have a Centos server with a number of virtual hosts, and my rails app
runs under one of those virtual hosts using mongrel_rails. The app lives
in /home/mydomain/railsapp where /home/mydomain/railsapp/public is the
rails root.
It runs under mongrel on port 8008, so to get to it users invoke the url
http://www.mydomain.com:8008/ - all is fine to this point.
Now I have some users whose
2006 Jan 18
5
redirect_to with an anchor, how ?
Hello,
I try this :
redirect_to :action => ''infos'' , :id => params[:id] , :show => "comments#a"
i want this : .../infos/15?show=comments#a
but I have this : .../infos/15?show=comments%23a
Someone could tell me how generate an anchor link ?
Thanks
2011 Feb 12
5
link_to a action in the controlles is not called
i have a link where it has to call a method defin in todoscontroller
named say_when but show is called
<td><%= link_to ''Say when'', todo, :action => :say_when ,
:remote => true %></td>
class TodosController < ApplicationController
# GET /todos
# GET /todos.xml
def index
@todos = Todo.all
respond_to do |format|
format.html #
2006 Jun 07
0
passing a redirect_to action through a view to controller.
Hi,
I have a situation where I could link_to a shared action in my controller
through 2 separate use cases. In both cases, I''d like the action to execute
and then render the same exact page from where it was called. In other
words, just execute the action and then not do anything, maybe just refresh
the current page from where I called the shared action. If I do have to
specify an
2006 Jan 08
9
URL/Site structure
Greetings,
I''m fairly noob with rails and making my first DB driven site with it.
I''m using the scaffold generator to develop the admin side of my site
(admin_controller)
I have three sections that I want to have the administrator edit, and I
want to call these from the admin controller that has a layout with
navigation to these three sections.
When using the scaffold
2006 May 12
0
redirect_to with hash vs string and docs
Hi,
When I use redirect_to with a string (eg. redirect_to
"http://www.yahoo.com"), the browser is sent a response with a header
containing status 302. This is good for what I am doing.
If I use redirect_to with a hash (eg. redirect_to :action=>''list''),
the browser is sent a response with status 200 and the body contains
the destination of the redirection. This
2006 Dec 30
1
redirect_to(:action => ''foo'') and return
I''m not sure why this is happening, but if I do this in a controller
unless @variation && @variation.quantity > 0
flash[:error] = "Sorry, that product is currently not available."
redirect_to(:action => ''error'') and return
end
rspec tells me
2)
ActionController::DoubleRenderError in ''The Carts controller with an
2004 Oct 24
0
redirection bug ?
Hi
I use code from authentication example from ruby on rails web page.
Everything looked fine until i found thet when i log for the first time it
gives me bad redirection. When session[''return_to''] was set everythig
had been fine so i changed (look into my code) from 1 to 2.
this is from login controler
def login
if
2008 Mar 16
3
undefined method `redirect_to'
Hi all. I''m getting the following error in my app:
undefined method `redirect_to'' for ActionController::Base:Class
I''m using Windows 2000, Rails 2.0.2 and resource_controller (from
James Golick).
My controller:
class CommentsController < ApplicationController
include ResourceController::Controller
belongs_to :post, :article, :photo
create do
2006 Aug 03
1
Why doesn''t redirect_to handle rjs?
Is there a good reason why redirect_to doesn''t check responds_to, so
it can handle redirects in rjs calls? I''ve done something like this
in my app controller, seems to work ok...
alias_method :redirect_to_orig, :redirect_to;
def redirect_to(options = {}, *parameters_for_method_reference)
respond_to do |accepts|
accepts.html do
redirect_to_orig
2006 Jun 14
1
Absolute URL from link_to?
What options do I need to provide to link_to so that it generates truly
absolute URLs (i.e. including protocol://host:port/path)? It seems that
even when I provide :host and :protocol arguments to url_for that it
suppresses these when they match the current request.