Displaying 20 results from an estimated 2000 matches similar to: "Selecting conditionally from HABTM"
2005 May 31
2
Form Dates and MultiparameterAssignmentErrors
I''m using the date_select form helper for a date_of_birth field on an
ActiveRecord object. When I try to save a date earlier than 1 Jan 1970,
ActionController punts with
ActiveRecord::MultiparameterAssignmentErrors. The message it gives is
"1 error(s) on assignment of multiparameter attributes". I was able to
catch the exception and look at it, and it is certainly complaining
2006 Jan 12
4
Typecasting and boolean attributes
I have 2 radio buttons like this:
<%= radio_button ''group'', ''public'', true %>
<%= radio_button ''group'', ''public'', false %>
They hold the correct values when viewing the @group object. However,
when updating, it does not appear that the params[:group][:public]
value is being typecast correctly.
As
2005 Dec 31
9
RJS Templates not conducting callbacks
I''ve run across a weird problem with RJS that I''m trying to figure out:
I have an application that was running 0.13.1 that I recently upgraded
to Rails 1.0. I wanted to use RJS templates, so I installed the plugin
and updated my prototype javascript file via ''rake update_prototype.''
I attempted to test the templates out via the following code, but the
AJAX
2005 Dec 31
7
Application Errors w/ layout & custom view pages
1) I get Rails Application Error when trying to use layout
test_controller
def list
layout "stdlayout"
end
in the views/test/layouts stdlayout.rhtml
<html>
<head><title>test</title></head>
</body>
<h1>Test</h1>
<%= content_for_layout %>
</body>
</html>
2) I get Rails Application Error when trying to use a separate
2005 Oct 20
5
Unit Test Error: `load_specification': undefined method `parse' for Time:Class
All,
I''ve come across a confusing problem when attempting to run unit tests
for an application on OSX (works on Windows).
I''m receiving the following error:
`load_specification'': undefined method `parse'' for Time:Class (NoMethodError)
This is also confusing because I can''t figure out how the error
appeared. When I revert back to previous revisions,
2005 Sep 07
3
Autocomplete Error w/Version 1.5_pre4
I recently updated to version 1.5_pre4 to use the excellent in-place
editor, however, I''m now seeing a bug with AutoCompletion.
When text is entered in the text field for auto completion, the
auto_complete div is not updated (but the server does receive the
request and return a response). Upon removing focus from the text
field, 2 instances of the following error can be seen in both
2005 Dec 22
13
in-memory SQLite for testing
I am following the rails book, and arrived to the section about
testing. The test database is configured as:
test:
adapter: sqlite3
database: ":memory:"
and I get this error with the simple product test:
% ruby test/unit/product_test.rb
Loaded suite test/unit/product_test
Started
E/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/
errors.rb:94:in
2005 Sep 12
1
Edit In Place: text with line breaks
All,
I need to apply EditInPlace to a block of text that has line breaks.
I''d like to have the editable text load instantly by grabbing the text
from the page instead of using the "loadTextURL" option. However, this
will pull in the html formatting ( <br> and <p>).
Wanted to see what ideas the list had as far as making this possible -
the best idea I''ve
2005 Dec 31
3
[Model] [Noob] Table Naming w/ underscores
Greetings:
I am writing a basic accounting module for an app. Rather unfortunately the
name "transactions" is a reserved term in Rails (being the only accounting
term trully representational of a financial transaction). I am left to come
up with other names. One such name was f_transaction.
This worked on the DB level, but I noticed that the Model name dropped the
underscore, thus
2005 Dec 25
3
SQLite primary key schema
So after successfully getting the test SQLite db to run from memory, I
tried running some tests but found that somewhere in the schema
translation from Postgres (my devel database) and SQLite Rails fails
to properly set the ''id'' column, which breaks all kinds of things.
Take as an example my ''users'' table. In Postgres the schema is
(generated with pgAdmin III):
2006 Jan 13
1
Rendering an RJS template within another RJS template
Is there a way to render an RJS template within another?
I''ve put my simplified code below. No errors are generated, but the
partial isn''t rendered. I also tried using render :action =>
''update_actions''
destroy.rjs---
page.visual_effect :fade, comment_container(@object.id.to_s)
# update the number of comments(below is another rjs template)
render :partial
2006 Jan 02
6
Login_engine - auth against email rather that username?
Hi all,
Short of hacking the code apart, is there a method making the
login_engine authenticate against email address rather than username?
I find that people rarely remember usernames, and would prefer to use
email addresses as the identifier.
Thanks!
Tom
2006 Jun 14
5
display formatted date
Hi,
In my form I have date field set as ''datetime_select'' which is fine as I
wanted it in the same format. But while displaying (list action) it
displays date in long format i.e. ''Tue May 30 15:39:00 Central Daylight
Time 2006''. How can I format it so that it will just be diaplyed as
''dd/mm/yyyy'' format?
Thanks
--
Posted via
2006 Jun 16
5
BackgrounDRb / Testing Error: uninitialized constant BackgrounDRb
I''m digging into BackgrounDRb and having some problems testing a worker class.
The following line in my test (created from script/generate worker
Test) throws an error:
worker = TestWorker.new(:test_string => "testing...")
Error:
/activesupport/lib/active_support/dependencies.rb:123:in
`const_missing'': uninitialized constant BackgrounDRb (NameError)
from
2006 Jan 06
4
Design flaw with Fixtures?
I''ve been trying to add unit testing for collection of models with
complex relationships -- and failing miserably.
Because of the complexity of the relationships, I''m using a database
which validates foreign key constraints (PostgreSQL 8).
I''m finding it nearly impossible to generate tests that are independent
of each other. The basic problem is the DELETE then
2006 Apr 20
1
Setting :status for inline RJS?
Is there a way to set the :status when using inline RJS rendering in
controllers?
Something like:
render :status => 500, :update do |page|
page.insert_html ....
end
--
Derek Haynes
HighGroove Studios - http://www.highgroove.com
Atlanta, GA | San Mateo, CA
Keeping it Simple.
404.751.1762
2006 Jun 14
3
Which Payment Gateway?
I am working on an application where users sign up for one of several
plans. Each plan has a different monthly fee. There is no long term
contract but I would like to bill the users automatically each month
unless service is canceled.
What credit card gateways would you recommend for use with a rails
application?
My criteria in order of importance are
1. API that will let me work in
2006 Jan 02
3
rake test_units not loading any fixtures
Hello All,
If I run my unit tests individually using Ruby, they all work correctly.
However, if I try to run them using "rake test_units", I get a bunch of
error messages.
The error messages appear to be caused by rake not loading any of the
fixtures into the test database.
I am using PostgreSQL on Windows.
Does anyone have any suggestions?
Many thanks,
Bruce.
--
Posted via
2005 Dec 31
2
Test Unit Problem
Hello All,
I am experiencing the following test unit error working with Rails that
I can''t fathom.
I have a products.yml file which holds the following test fixture for
the products table:
dell_pc:
id: 1
title: Dell PC
description: Dell PC
image_url: http://.../pc_image.jpg
price: 15000.00
date_available: 2005-12-31 06:53:00
I also have the following product_test.rb file to
2006 Aug 15
8
AGAIN: file object treated as string
I am trying to implement the uploading of a file to a remote server
I get error while trying to write the file on the server. The error I
get is the following:
undefined method `rewind'' for #<String:0x2aaaad062eb8>
It seems to be treating my file as a string instead of a File object.
--------- Code is below ------------------
VIEW:
<%=