Displaying 20 results from an estimated 7000 matches similar to: "Testing the flash is brittle?"
2006 Jun 22
3
attr_boolean, a good idea?
Hello all,
I''ve recently been working with a model with a lot of boolean
attributes and I decided that it''s worth trying to implement a
attr_boolean function to cut down on the work. Something like
class User < ActiveRecord::Base
attr_boolean :contact_by_email, :display_real_name, :administrator
end
which would replace the hand written
class User <
2006 May 23
1
Validating a required relationship.
Hello,
I''m not sure if I''m missing something blindingly obvious here.
All the relationships that Rails comes with assume 0..n, yes? It''s
not a strict 1 to 1 or 1 to n because it''s optional. My question is
this -
What is the best way to implement a required relationship?
For example, if I require that a comment is made by a user (a user
has many
2007 May 17
4
How to mock helpers in view specs ?
Hi all,
I am mocking the following Rails view (inside a partial):
<%= render :partial => "forums/forum",
:collection => forum_category.forums.readable_by(current_user? ?
current_user : nil) %>
My spec fails with the following message:
1)
ActionView::TemplateError in ''forum_categories/index (anonymous user)
should only render forums accessible to anonymous
2005 Dec 07
5
InPlaceEditor update of page contents ?
Hi all !
InPlaceEditor refreshes only the element that was updated. Is there
any way to make it update tons of other stuff ?
I have a table where changing a value in it causes changes in most
other cells (weight to percentage to money).
Thanks for any help !
--
François Beausoleil
http://blog.teksol.info/
_______________________________________________
Rails-spinoffs mailing list
2006 Jul 26
2
ResponseLogger Plugin
http://www.agilewebdevelopment.com/plugins/responselogger
From the README:
Ever wondered what exactly Rails returned in an RJS response ? Here''s
your chance to see it:
===> text/javascript (49 bytes)
Element.replace(''target'', ''<em>It works!</em>'');
<===
== ResponseLogger
Logging the response value is easy. Simply install
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all,
Yesterday, I had some problems reading JPG files in my tests. Turns
out the problem was that Windows Ruby doesn't set it's Tempfile to
work in binary mode. Since I deploy on Linux, that has never been a
big problem, but now I'm working on some software that works with
binary files exclusively.
Anyway, I am making this fix available as a Rails plugin.
The details can be
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all,
Yesterday, I had some problems reading JPG files in my tests. Turns
out the problem was that Windows Ruby doesn't set it's Tempfile to
work in binary mode. Since I deploy on Linux, that has never been a
big problem, but now I'm working on some software that works with
binary files exclusively.
Anyway, I am making this fix available as a Rails plugin.
The details can be
2006 Jul 20
5
Apache 2.2, Mongrel and #caches_page
Hi !
I''m no expect when it comes time to configure Apache. I just enabled
page caching in my Rails app, and am now looking at making Apache
serve the cached files instead of calling into Rails.
I know Mongrel is able to serve cached files if it finds them, but I''d
like Apache to do it.
Looking at .htaccess, there is this section:
RewriteEngine On
RewriteRule ^$ index.html
2006 Mar 24
8
[OT] Does Net::HTTP support secure connections ?
Hi !
I''m trying to connect to an https URL, but it seems it doesn''t work.
Has anyone successfully connected from Ruby to an HTTPS server ?
Thanks !
--
Fran?ois Beausoleil
http://blog.teksol.info/
2006 Feb 24
6
when i save, rails doesnt update the model instance with the id of the new record
Hi everybody,
Im using sqlserver (sqlserver adapter).
I think that is some bug.
any idea?
--
_________
Noel R. Morais
2006 Aug 25
10
SVN security hole explained
Hi all,
If you are using Pound / Pen or another load balancer, I believe you
should read this:
http://blog.teksol.info/articles/2006/08/25/subversion-metadata-exposure-on-mongrel
My article refers to Dan Benjamin''s
http://hivelogic.com/articles/2006/04/30/preventing_svn_exposure
My point is that even though we are preventing Apache from serving
anything except a select few file
2006 Mar 30
9
script/console not working after Rails 1.1 upgrade
Whenever I do script/console I get an error message:
Loading development enviroment.
c:/ruby/lib/ruby/1.8/irb/init.rb:151: in ''parse_opts'' : undefined method
''upcase'' for nil:NilClass (NoMethodError)
from c:/ruby/lib/ruby/1.8/irb/init.rb: in ''setup''
from c:/ruby/lib/ruby/1.8/irb/init.rb:54: in ''start''
from c:/ruby/bin/irb:13
2006 Mar 07
5
subversion help!
I created a subversion repository on my new vps and i''m trying to setup my
rails app there. However i keep getting this error:
subversion/libsvn_subr/io.c:2516: (apr_err=13)
svn: Can''t create directory ''/home/svnadmin/rapleaf/db/transactions/0-1.txn'':
Permission denied
How do i fix this? I know others have had this before, so i would
appreciate some help.
2007 Dec 19
2
Nested partials losing the view context ?
Hi all !
I can''t seem to make a simple thing work... The code is here:
http://pastie.caboo.se/130660
Essentially, that''s a form with a couple of partials. The backtrace is
included in the pastie. It looks like the context for the current view
is lost when a partial is rendered. In _series.html.erb:2, I use
"series" to get the name. This is the parameter I
2006 Jul 31
2
Testing the flash.now
What''s the best way to test the flash when you use flash#now ? For
example, if I set the flash in my controller:
flash.now[:notice] = ''This will only show up on this action.''
How do I test it? Normally I would do:
assert_equal ''This will only show up on this action.'', flash[:notice]
But this doesn''t seem to work with flash.now.
Any
2006 Mar 14
7
Single form w/ relationships: how do I integrate it?
OK - I know this has been asked before, but I cannot find it in the
archives. Forgive me if I''m creating more noise than I should.
I want to know the easiest way to deal with this scenario:
I have articles. I have categories for the articles.
On the form where you write an article, there needs to be a free-form
field to entire the category.
The create() method will build the
2006 Jan 24
4
Laszlo on Rails, Flash GUI
Ruby Forum Search did not work, and I did not find any postings about
http://laszlo-plugin.rubyforge.org/. OpenLaszlo is a framework handling
the GUI part, or the V in MVC. See
http://www.laszlosystems.com/lps/laszlo-in-ten-minutes/ for info about
Laszlo itself.
My question is, does anybody have experience with this framework,
especially combined with Rails?
Or, could I get some of the best
2006 May 03
8
Subversion and tmp directory in Rails 1.1 project
Hello everyone!
I''m thinking of the right way to store tmp/ directory of Rails 1.1
project in Subversion. It has cache, session and sockets
subdirectories. To me, it looks good to have
svn delete tmp/*
svn propset svn:ignore "*" tmp
So it will ignore all directories and files in tmp/. Even if you
create sessions/ and put some files in it, tmp/ content is still
ignored.
But
2007 Jan 24
7
Differences between assert_tag and assert_select
Hi all,
I can't seem to make assert_select work for the more complex cases for me.
Here's a sample:
# View
<%= link_to_remote 'Add new', :url => new_phone_url, :submit => 'phones_head' %>
# Generated code:
<a href="#" onclick="new
Ajax.Request('http://test.host/admin/parties/phone/new',
{asynchronous:true, evalScripts:true,
2006 May 16
4
question about strftime when called from partial.
Hi,
I''m calling a helper I''ve written - format_time() that is called from my
views with a given time that was selected from my database and was returned
to the view via an instance variable. When I call format_time from a
partial, I see that I get some kind of String error and the partial won''t
render. Basically, the object being passed in to format_time is already a