Displaying 20 results from an estimated 50000 matches similar to: "Making the browser cache an action"
2010 Apr 22
7
Making ActiveSupport::Cache consistent
Lighthouse ticket: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4452
I have recently been working on some gems that utilize
ActiveSupport::Cache and ran into some issues with the different
implementations handling the same functionality differently. One of
the issues was that I couldn''t rely on expiring entries with
the :expires_in option. MemCacheStore takes this
2006 Mar 16
4
Handling/Catching Exceptions
Hello!
I was wondering, sometimes I raise an exception in my Rails apps, e.g.:
raise SecurityError unless @post.user == logged_in_user
Now: is there any way to catch that SecurityError exception somewhere
and render a custom template? E.g., I want to render
''app/views/content/security_error.rhtml''
Does anyone know how to do this?
Thanks a bunch,
Rob
2006 Apr 01
4
Custom Validations
Does anyone how to create a validation that:
validates_presence_of :a OR :b
I.e. :a OR :b must be present.
I thought this would probably be possible with some kind of validation
callback, e.g.:
def check_a_or_b_is_set
return (a or b)
end
Any ideas?
Thanks,
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2008 Nov 19
3
Rails.cache and problem with model id?
I have the following:
MODEL:
def self.get_tag_cloud
Rails.cache.fetch(''fetish_tag_cloud'', :expires_in => 1.hour) do
find(:all, :conditions => [ "approved_for_tag_cloud = true"], :order
=> "LTRIM(name)")
end
end
CONTROLLER:
def index
@fetishes = Fetish.get_tag_cloud
end
VIEW:
....
<% @fetishes.each do |fetish| -%>
2012 Nov 03
1
Volatile cache keys with Rails and Redis
Does Rails automatically set an EXPIRE attribute on keys when working with
Redis, or will an old key sit there forever if it''s never manually cleared
out? This is mostly a concern when using ActiveModel''s "cache_key":
<%= cache @post do %>
The cache-key will be something like views/posts/744-20120613070958 . When
the post is updated, and therefore gets a new
2006 Apr 01
2
Textile headaches
I have the newest version of RedCloth installed (3.0.4). I want the
following output:
<h1>Header</h1>
<p>Some text</p>
This is what I tried but no luck:
irb(main):002:0> require ''rubygems''
=> true
irb(main):004:0> require_gem ''RedCloth''
=> true
irb(main):006:0> RedCloth.new("h1. Header\r\nSome Text").to_html
2006 Apr 14
2
Markaby trunk broken?
Hello!
Does anyone know how I can check out the Markaby trunk? I''m getting this
error:
<code>
ruby script/plugin install
http://code.whytheluckystiff.net/svn/markaby/trunk
+ ./trunk/svnindex.xsl
/usr/local/lib/ruby/1.8/open-uri.rb:290:in `open_http'': 404 Not Found
(OpenURI::HTTPError)
from /usr/local/lib/ruby/1.8/open-uri.rb:629:in `buffer_open''
2006 May 21
3
Sending mail times out (ActionMailer)
Hi!
I''m on debian. Sending a mail from Rails times out:
Timeout::Error (execution expired):
/usr/local/lib/ruby/1.8/timeout.rb:54:in `new''
/usr/local/lib/ruby/1.8/net/protocol.rb:206:in `old_open''
/usr/local/lib/ruby/1.8/timeout.rb:56:in `timeout''
/usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout''
2006 Jun 06
14
How can I set the session in a functional test?
Hey :)
I need to simulate a login in my functional test, otherwise I can''t GET nor
POST to the action.
I need to set the session key "logged_in_user_id".
I tried this inside the setup() method:
session[''logged_in_user_id''] = 1
But that throws: TypeError: can''t convert String into Integer
Any ideas?
Thanks,
Rob
-------------- next part
2006 Jun 06
5
Functional tests and protected actions
Hello!
I have certain methods in my Application Controller, that I need to access.
Namely ApplicationController#logged_in_user
The problem is, that when I try to access it, I get:
NoMethodError: protected method `logged_in_user'' called for
#<AdminController>
Any ideas how I can circumvent that?
Or are functional tests really not suited for any kind of logins and session
work?
2009 Mar 14
2
Rails, lighttpd and the Expires header
I have a controller that serves up images from a different location
from /public/images/ by using send_file or send_data on /media/thumbs/
38 for example
In lighttpd I have:
expire.url = ( "/media/" => "access 10 years",
"/stylesheets/" => "access 10 years" ,
"/javascripts/" => "access 10 years",
2006 Jul 16
1
Don''t log params
Hello!
I need to supress the logging of params for certain actions, i.e. I don''t
want the params hash to show up in one of my actions.
Does anyone know how to do that?
Thanks,
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060716/62b2e2d5/attachment.html
2009 May 26
2
memcache for variables
hey,
for performance reasons i want to cache (template) variables using
memcache, making access to data easy in templates by using a simple
syntax like <%=users(2).name%>. this actually should tell the view to
load the field ''name'' from the model/table ''users'' with id=2. it first
tries memcache and if not found, loads the data from the and stores it
in
2009 Aug 02
4
X11 theme cursors
If anybody know HOW I can use the X11 cursor theme in Wine?
2006 Mar 28
2
JS Toggle graphics on action / click
I''ve got a simple toggle option (On/Off) in my admin GUI list action. I
would like to click on this graphic and change the status of the option.
I got the whole thing working in the controller & db through this
beautiful one-liner
@item = Item.find(params[:id]).toggle!(''display_status'')
The thing I can''t achieve - even after several hours of labouring
2008 Jan 18
16
Need a good RoR developer
Hi, I''m looking for qualified Ruby on Rails developers to work on a
client web portal project in Midtown Manhattan for a large financial
research company.
Requirement Overview:
Ruby / Ruby on Rails developer with strong object oriented programming
background. Good understanding of model driven architecture, MVC, RDBS
and data modeling.
Required Skill Set:
- BS. in Computer Science (or
2007 Nov 06
1
WoW action bar shortcut little annoyance : looking for a clue
Hello,
I use latest Wine version (0.9.48) to play World of Warcraft latest version (2.2.3) but I have been
having a little bug with action bar, for not such a big while, and wonder what can cause it. So I'm
looking for a clue (some log ?) to diagnose what happens on my machine (it works on a friends' one
with somewhat the same configuration : same versions of WoW and Wine, Ubuntu Gutsy
2010 Sep 07
3
[LLVMdev] MS VS2008 build fails - X86AsmParser
Hi all,
Just tried to build from svn sources with Visual Studio 2008, mostly
OK but fails
building the X86AsmParser lib -
I see a few commits from yesterday that may have something to do with it, but no
idea what the solution is.
-David
See MSVC's beautiful and concise output below;
Compiling...
X86AsmParser.cpp
C:\dev\MSVisualStudio\VC\include\xutility(313) : error C2664: 'bool
2008 Sep 28
4
Cannot expire cache from background process?
Hello,
I am trying to expire fragments (or at least trigger their expiration)
from a daemon that''s running in the background.
The daemon is updating all kinds of important lists every few minutes
from the background.
So I have to find some way to DO or TRIGGER the fragment caching from
this daemon.
Unfortunately just using the normal commands like:
expire_fragment :controller =>
2009 Feb 16
2
A beautiful panic action
Trying to add a new driver using add printer wizard.
A panic action occur :
m403 (10.217.5.209) connect to service print$ initially as user spu
(uid=0, gid=221) (pid 8619)
[2009/02/16 10:40:35, 0] lib/fault.c:fault_report(40)
===============================================================
[2009/02/16 10:40:35, 0] lib/fault.c:fault_report(41)
INTERNAL ERROR: Signal 11 in pid 8619 (3.2.4)