Displaying 20 results from an estimated 3000 matches similar to: "Action caching with params"
2010 Aug 09
0
Expanding tests with own methods
I want to call the method ''url_for'' in my functional test.
e.g. assert_select "a[href=?]", url_for(:action => :new), :text => ''Neue
Seite''
The book I am reading suggests doing this:
class PagesControllerTest < ActionController::TestCase
def setup
def self.url_for(options, *parameters_for_method_reference)
options.merge! :only_path
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 12
2
Strange error: undefined method `rewrite''
Hi,
when I generate a new rails project with a simple scaffolded controller,
I get a strange error message, whenever it tries to call the url_for
method, for example:
,----
| undefined method `rewrite'' for #<Url:0xb7675e64>
|
| Extracted source (around line #7):
|
| 4: </p>
| 5: <% end %>
| 6:
| 7: <%= link_to ''Edit'', :action =>
2006 Mar 25
0
in_place_collection_editor
Hi,
I''m trying to write a helper for Scriptaculous'' InPlaceCollectionEditor
component. I''ve already submitted a patch
(http://dev.rubyonrails.org/ticket/4302). This was a drunk patch; it
needs a bit of work (Don''t drink & code!). So far I''ve gotten it to work
correctly with normal collections, but I want to use it for belongs_to
relations as
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 22
1
url_for params
Hi,
url_for has a nice way of using the current ''params'' object to fill in default
parameters in a route. For example,
map.connect '':controller/:action/:id/''
with <%= url_for :action => ''my_action'' %> will redirect to the current
controller. All very good.
However, I sometimes want a url_for() which includes current parameters
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
2006 Sep 07
5
url_for always escape string.
according to the documentation, only the url_for from ActionView escape
the
URL.
which happens on this line
escape ? html_escape(url) : url
and can be prevented by passing :escape =>
false to url_for.
still according to the documentation, the url_for from ActionController
is not supposed to escape the url.
BUT IT DOES.
at the moment of this line
escape ? html_escape(url) : url
url has
2008 May 16
0
Problem with :action => 'destroy' in url_for
url_for( :controller => ''foo'', :action => ''destroy'', :id => 1 ) => ''/
foo/1''
url_for( :controller => ''foo'', :action => ''destroy_x'', :id => 1 ) => ''/
foo/destroy_x/1
url_for( :controller => ''foo'', :action => ''destroy'', :foo_id => 1 )
2008 Apr 04
0
cacher v0.1-2
The 'cacher' package contains a set of routines for caching statistical
analyses. The idea is that an analysis stored in a file (say, 'foo.R') is run
and the results of the evaluated expressions are cached in a database. These
cached results can subsequently be packaged up and distributed over the interweb.
I've just uploaded to CRAN version 0.1-2 of the 'cacher'
2008 Apr 04
0
cacher v0.1-2
The 'cacher' package contains a set of routines for caching statistical
analyses. The idea is that an analysis stored in a file (say, 'foo.R') is run
and the results of the evaluated expressions are cached in a database. These
cached results can subsequently be packaged up and distributed over the interweb.
I've just uploaded to CRAN version 0.1-2 of the 'cacher'
2006 Feb 27
0
Mapping '':action/:id/:controller/'' doesn''t work
Hello People,
(I am not good at ROR yet. This post could be very lame.)
I am going playing with routes.rb.
Well, pretty much any combination of mapping works, a part from:
map.connect '':action/:id/:controller/''
In this case, the request is routed; however, I get:
---------------------------------------
Showing app/views/inputs/start.rhtml where line #8 raised:
No url can be
2014 Jun 04
0
Design question: Redirection to a "create" action.
My application should behave like this:
- My application manages (among others) a resource called "Dicts", i.e.
there is a dicts_controller, and my routes.rb contains a "resources
:dicts".
- I have a home page (starting page), which will eventually contain some
user authentification (not implemente yet), and then allow the user to
manage the Dicts objects. I have a
2006 Jun 27
2
Serve an image up from an action
What I am really trying to do is use the file_column plugin for the file
uplaod/storage (to a non-application directory), but serve up the images
on my own (without the mage_tag url_for_file_column technique)
In the java world, I would simply do something like this:
<img src="myImageServlet?id=1">
and myImageServlet would simply return the appropriate mime headers and
data
2006 Jan 21
1
clearing/expiring the ''index'' action.
Hi all,
I''m having problems trying to expire the ''index'' action of a controller.
In short,
expire_action :action => ''index''
doesn''t work, but
expire_fragment (url_for :action =>
''index'').gsub(/\/index/,'''').split("://").last
works fine and deletes the cached page as expected.
I
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 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
2015 Jan 09
0
Processed (with 2 errors): user debian-qa@lists.debian.org, affects 774889, affects 771755, unarchiving 767561 ...
Processing commands for control at bugs.debian.org:
> user debian-qa at lists.debian.org
Setting user to debian-qa at lists.debian.org (was anbe at debian.org).
> affects 774889 + xfswitch-plugin
Bug #774889 [gdm3] gdm3: fails to upgrade squeeze -> wheezy -> jessie - trying to overwrite /usr/share/gdm/BuiltInSessions/default.desktop
Added indication that 774889 affects xfswitch-plugin
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 Oct 23
0
Invoking a remote (AJAX) action via double click
I have a list of images on one of my pages, and I would like for the
act of double-clicking on any of them to do a remote request to an
action. In this case, I''d like to pop up a redbox that is a dialog
about the item I clicked on. I found some example code like this:
<%= image_tag "image.jpg",
:class => "image",
:ondblclick =>