Displaying 20 results from an estimated 40000 matches similar to: "Caching"
2011 May 17
8
Changing Rails Default Date Parse Option
Does anyone know how to change the default option for the Date.parse
(which ActiveRecord is using on all date fields). I would like the
"comp" option to default to true so I don''t have to account for 2-
digit dates throughout my application.
http://corelib.rubyonrails.org/classes/Date.html#M001228
Thanks!
Tom
--
You received this message because you are subscribed to the
2011 Feb 17
9
Page Caching... extending it???
Hey there
Is it possible to intercept Action Cache to force it to use a
specified filename to save to.... or to load a specified cached file
that is different to the current one expected for the URL?
I guess this is some sort of "extending" of action cache.... but I
cannot find much in google :)
thanks
--
You received this message because you are subscribed to the Google Groups
2009 Nov 26
6
will_paginate don't work on jruby platform
Hello all,will_paginate don''t work on jruby platform,
the Model.paginate find works ok, accepts all kinds of params,
this is config.gem
config.gem ''will_paginate'', :version => ''2.3.11'', :source =>
''http://gemcutter.org'',
but <%= will_paginate @collection %> doesn''t work
it always produce nil(so nothing on page).
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them
do not. Does anyone know if there is a way to disable the HttpMocks
after they have already been loaded? The method
ActiveResource::HttpMock.reset! only removes all the objects, but
ActiveResource still thinks it should look for mock requests rather
than actually making requests. I hope this makes sense!
Thanks,
Tom
--
2013 May 12
10
Capybara with redirect
I am having an issue where a feature works fine but the corresponding
test fails, and I can''t understand why.
I created a mock application to demonstrate the problem.
https://github.com/assafshomer/clear_button
All it does is show an input form with a clear button. The clearing
happens by redirecting back to the same form. It does clear it when you
run the app, but the test for it
2010 Nov 27
2
Long elaboration
Well....
my problem is that after form post, I have to do a long elaboration.
So, my page remain stuck for a long time....
I would like to display an intermediate page after post (thank for your
collaboration..blah, blah, blah.....)
so that the visitor knows whats going on.
Any suggestion?
Thanks in advance...
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
2010 Feb 19
2
Problem with assert_redirected_to
I have taken over some old Rails code and am trying to get the tests to run.
In the functional test every time the assertion ''assert_redirected_to'' is
called I get the following error:
test_should_update_venue(VenuesControllerTest):
NoMethodError: undefined method `[]'' for
#<Enumerable::Enumerator:0x102f747e0>
2010 Sep 12
11
Rails 3: finding a record by name in multilingual app
Hello,
I upgraded my application from Rails 2 to Rails 3 and ran into a
problem. In rails 2 I could use the english name of the record to find
it like:
Page.find_by_name("Welcome")
even though the user chose German as the language (which of course
showed the German welcome page.
Eversince I switched to Rails 3 (default_locale still :en) I can''t find
anything by giving the
2012 Nov 09
8
method conditional option pattern
When I have this pattern
sign_me(@user, :event => :authentication, :subdomain => subdomain)
how can I write it to avoid sending the :subdomain option if subdomain.nil?
( if possible ..)
sign_me(@user, :event => :authentication #?, :subdomain =>
subdomain unless subdomain.nil? )
--
You received this message because you are subscribed to the Google Groups
2012 Oct 23
7
Not updating the updated_at field
This is for Rails 3.1.1
I have a field called last_seen in a model. This field will be updated
when the something about the record is seen in the real world (don''t
worry about this part)
So I go x.update_attribute(:last_seen, Time.now) and the following happens is
UPDATE "blah" SET "last_seen" = ''2012-10-23 08:57:46.179288'',
"updated_at"
2010 Apr 20
5
Spring Cleaning
Right now in my view, I have a whole HUGE clump of
<% if current_user %> and then <% if current_admin %> and then <% if
current_teacher %> and then all that other stuff in my view.
I have a ginourmous chunk of if and else statements in my views... is
there a way to make it prettier? The if and else''s almost all have the
same functions, expect for some minor changes.
2010 Oct 04
4
http caching a dynamic page
Is it possible to take advantage of http caching/proxy caching with
dynamic pages? i.e. pages with section/part that can change over time
but certain part of the page remain the same. I would rather not keep
re-rendering the static part but insure the dynamic part are rendered
with fresh data.
I am using memcached mostly as an object store that I can minimize db
hits but I still am rendering a
2010 Nov 29
3
session active_record_store
Hi,
There doesn''t seem to be any previous posts about this problem, I must
be
setting things up wrongly at very basics...
Firstly, the problem... I can''t get session[] to persist with
active_record_store. I enabled (config.action_controller.session_store =
:active_record_store) in environment.rb and created the sessions table
at my MySQL database. When I do a session[:blah] =
2010 Jan 15
21
Dynamic Assets - can it be done?
I''m looking for 3 areas to work as dynamic assets:
image_path, javascript_path, and stylesheet_path
When I say dynamic, I mean that they will be dynamic through
controller/models. I have been working through approx. 12 hours of
searches to satisfy my answer to this question but am not finding much
luck.
The closest things I''ve found enabling this are use of config for assets
2010 Sep 27
7
Uploading photos
Hi all,
Learning RoR (and loving it!) to develop a website. A requirement of the website is enabling users to upload photos to be made viewable (dynamically) on the website. Is this something I can develop with RoR?
Thanks,
Jeff
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2011 Apr 13
3
Question about ERB performance
I''m trying out rails 3 and I''m looking at the performance statistics
given by WEBrick.
It says many of my database operations are taking 2ms or 7ms... but
the view is taking 40ms. People often say that the database is the
bottleneck in applications (which it most certainly can be, and often
is)... but isn''t the rendering of ERB a little show here? My test
pages really
2011 Feb 20
7
Using Nokogiri to insert a <span> tag into existing text
All,
I''m using Nokogiri to handle the following problem:
I have a piece of HTML, and for certain text nodes, I need to insert
<span> tags into the text of these nodes at a certain place.
What I am doing is finding the place where I want to insert the <span>,
let''s say index X of the text node''s text, and doing the following:
1) Setting the node''s
2012 May 12
12
before_save messing up
#user.rb ------> Model
class User < ActiveRecord::Base
attr_accessible :email, :name, :password, :password_confirmation
has_secure_password
before_save :create_remember_token
.
.
.
.
.
.
.
private
def create_remember_token
self.remember_token = SecureRandom.urlsafe_base64
end
end
#sessions_controller.rb ------->
2012 Sep 18
4
multiple modules defining same method included into a class
In Ruby, classes are never closed: you can always add methods to an
existing class. This applies to the classes you write as well as the
standard, built-in classes. All you have to do is open up a class
definition for an existing class, and the new contents you specify
will be added to whatever''s there. In the same regard, if module is
used with the name of a pre-existing module that
2010 Feb 23
2
Logging and Exceptions with Script Runner
I have cron jobs that run script/runner commands and I have two
questions:
1. Should logging be working when calling the logger methods from an
object within the script?
2. Should Exception Notification work when an exception occurs in the
script/runner?
Thanks!
Tom
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to