Displaying 20 results from an estimated 400 matches similar to: "session[:return_to] for going back."
2006 May 08
4
link_to - Going Back without knowing the action name.
Hi,
I have a bunch of link_to''s in my code that are simple Back buttons that
should basically just go to the previous request. Is there a way of doing
this without specifying the action to execute? The problem is, sometimes I
may render the same view through separate actions so I wouldn''t know which
action to go back to.
Thanks.
-------------- next part --------------
An HTML
2008 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here:
http://wiki.developers.facebook.com/index.php/Facebook_Styles
I included testing and comments. I hope you find it useful.
Curiously, it''s really a small extension of FBML.
Richard
-------------- next part --------------
Index: test/rails_integration_test.rb
2013 Jan 18
1
redirect_to(session[:return_to]) vs session.delete
Hey all,
Recently I''ve been looking into on how to return back to a previous
referring URL and and the most common approach is:
redirect_to session[:return_to]
But some recommend:
redirect_to(session.delete(:return_to) || default)
How I understand it, in the second example we call session.delete so it
will clear the return path since we will no longer need it, and we also use
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to
determine whether the link url used is complete with hostname and path,
or just has the path (a kind of relative url).
However, in url_for it defaults to false (urls with hostnames), and in
link_to it defaults to true ( urls without hostnames, just paths).
Is there any reason for this discrepency? To me, it violates the
principle
2005 Nov 29
0
undefined method `link_to'
Hi, all I''m trying call link_to from another helper
but got this error:
undefined method `link_to'' for module `UserHelper''
how can I get access to helper from another helper? this is my
users_helper.rb:
module UsersHelper
alias ink_to_original link_to
alias link_to link_to_permission
def link_to_permission(name, options = {}, html_options = nil,
2006 Sep 04
2
how to? link_to with a rel="tag"
i want my html output to look like this:
<a href="/path/to/page/" rel="tag">link text</a>
how do i tell the link_to method that i need: rel="tag"?
thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send
2006 Jan 11
5
stack level too deep problem
Hi all, I''m trying to overload the link_to function, (to disable link_to if
the user has no access right)
this is my code, it work the first time I run the application, the second
time I refresh the page I always get "stack level too deep error"
module UsersHelper
include ActionView::Helpers::UrlHelper
alias_method :link_to_original, :link_to
def permission?
true
2006 Jan 17
6
link_to or helper to generate a javascript:history.back() ?
Hello,
There is an link_to option or an helper that generate a link like :
<a href="javascript:history.back()">Back</a>
Thanks
2006 Mar 27
13
Is this a bug in Ajax handling?
When a controller responds to a link_to_remote with a redirect_to, the
link_to_remote gets a success callback, this would seem like a bug to
me, at a minimum it should return a failure?
This is driving me crazy because all the login engines/generators
respond to an authentication error with a redirect_to. The work around
is to change them to all do a
render :layout => false, :status => 500
2006 Aug 02
2
Passing Ajax.InPlaceEditor options
I''ve followed the instructions in the Rails Recipe #1 and have the
in_place_editor_field working but now I want to tweak how it looks and
behaves. I''d like to be able to override the default yellow highlight color,
which is done using the highlightcolor param according to the scriptaculous
documentation (unless I''m missing something).
I''m new to Ruby and Rails
2006 Nov 04
2
in_place_editor_field submitOnBlur & okButton=false options?
I have a few in_place_editor_fields working fine. I can access some of
the script.aculo.us options such as :cols, :save_text, :cancel_text, but
how do I access the okButton = false & submitOnBlur options? Basically,
I want no submit button, a cancel button, and the ability to submit when
I tab out of the field.
Is this doable without writing a helper? (avoiding digging that deep so
2006 Jul 24
2
InPlaceSelectEditor question
I''m attempting to use the example given in the Rails Recipes book chapter 2,
to create a select drop-down using the InPlaceEditor function (modified to
be InPlaceSelectEditor.
The example given works (a country list drop-down), but I''m attempting to
use it to display a list of items generated from an object in another table
that is linked to the table that I''m editing.
2006 Jun 28
2
Saving and reproducing a POST request.
Hi
I have an action which saves the originating resource from which it
was called, and returns to it later. This is done by setting:
session[:return_to] = request.referer
...
redirect_to(session[:return_to])
Which works great for GET resources. The problem is that POST
variables aren''t kept in request.referer, so this method fails when
the originating resource is a a POST.
2008 Sep 11
4
(unknown)
I do not seem to understad what this error is about. Some body help.
wrong number of arguments (1 for 2)
RAILS_ROOT: C:/INSTAN~1/rails_apps/project/config/..
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/controllers/user_controller.rb:10:in `authenticate''
#{RAILS_ROOT}/app/controllers/user_controller.rb:10:in `process_login''
2006 Jun 06
1
Redirect\Cookie bug with MSIE 5.5sp2
Hello all,
There seems to be a bug in internet explorer 5 where a redirect
causes the session to be lost.
A controller says....
def login
case @request.method
when :post
if @session[:user] = User.authenticate(@params
[:user_login], @params[:user_password])
return redirect_to(:action=>''send_confirmation'') unless
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening:
>>>
module StoreHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes["style" ] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
# format_price method ...
end
Note that we cheated slightly here. We copied code from the Rails
2007 Mar 23
1
How does this helper work? (agile book)
Hello,
Im trying to understand how this helper method works:
def hidden_div_if(condition, attributes = {})
if condition
attributes["style"] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
This is how they are calling it:
<%= hidden_div_if(@cart.items.empty?, :id => "cart") %>
2008 Dec 28
1
escape character problem
Hi, i need to construct a link as following
"<a href=\"#{CONFIG[''URLS''][''Xyz'']}\#{url}\"#{tag_options}>#{name ||
url}</a>"
But here due to escape character #{url} not give actual value it
treated as a string. how to solve this ?
if i do
"<a
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi,
I just installed Rails 2.0.2
[root@mymachine easyx]# ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
[root@mymachine easyrx]# gem install rails --include-dependencies
Need to update 16 gems from http://gems.rubyforge.org
................
complete
Successfully installed rails-2.0.2
[root@remandev easyrx]#
But I''m getting this error in my restful_authentication
2006 Jul 21
4
Autocompleting InPlaceEditor
Hi,
I''ve created some extensions to script.aculo.us InPlaceEditor, allowing
the use of either server-driven, or local autocompletion. I''ve also
created new helper methods in Rails for this functionality.
My question is, is there any interest that I package this and make it
available as a plugin, or something like that?
Regards
--
Ola Bini (http://ola-bini.blogspot.com)