search for: realityforge

Displaying 20 results from an estimated 25 matches for "realityforge".

2006 Mar 01
5
validations without AR - going crazy trying to find link
Hi, in the past few months someone posted an entry on their blog about how to do validations in non-AR classes and I cant find it any more. Anyone have a link? Thanks, Trevor -- Trevor Squires http://somethinglearned.com
2005 Dec 20
7
wrong id for activerecord object when using :joins in mysql
I''m using a find with a :joins clause, like this: :joins => "JOIN table_b ON table_b.id=table_b_id" The records returned are used in a scaffold generated list page. The edit, show, and destroy links are getting the wrong id. They are getting the id of the table b record. When I run the query using mysql, I see that the query returns *2* id columns, the id of the main
2005 Dec 16
4
Validation with Aggregation
ActiveRecord supports composed_of for value objects which is fantastic but one thing that it doesn''t seem to support (or at least I am unable to find any documentation for) validation of the value objects. For example, given the following: class Message < ActiveRecord::Base composed_of :sender, :class_name => ''EmailAddress'' composed_of :recipient,
2006 Mar 20
2
Rails Plugin to Help Debug Views
...add a button that will popup a new window that displays the following debug data; * Request Parameters * Session Variables * Flash Variables * Assigned Template Variables It was derived from code that traces back to Marten Veldthuis in Epilog. You can check out webpage and plugin via; http://www.realityforge.org/articles/2006/03/20/rails-plugin-to-help-debug-views -- Cheers, Peter Donald
2006 Mar 15
0
Rails Plugin to Validate (X)HTML and CSS
Hi, I just released an enhanced version of Scott Raymond''s assert_valid_markup plugin that I have been using. Basically it allows you to validate (X)HTML or CSS files generated by application during testing. I have described the basics of it at; http://www.realityforge.org/articles/2006/03/15/rails-plugin-to-validate-x-html-and-css or you can grab it from subversion at http://www.realityforge.org/svn/public/code/assert-valid-asset/trunk/ -- Cheers, Peter Donald
2006 Jan 30
3
ActiveRecord without database
The question is this. Can I use ActiveRecord without the presence of a database? I use only YAML file for my project and I would like use the power of ActiveRecord for my models. I have not tested and so I ask you if this is possible. Thanks so much. --Reis -- Posted via http://www.ruby-forum.com/.
2006 Jun 25
3
Dummy field in a model
I want to have a field in model, which I''m not storing in a database. And I want to do something like the following in the model code : validates_format_of :field_NOT_in_db, :with => session[:field] How can I do it ? Thanks, Pratik -- rm -rf / 2>/dev/null - http://null.in
2006 Aug 16
5
too many SESSIONS?
I just notices my app was down, and in the log file were lots of these: No space left on device - ../config/../tmp/sessions//ruby_sess.898b1cf95e14f8e3 So i figured that i had too many sessions. I went through and deleted the sessions and then in a few minutes, the site was back up again. Can anyone explain this? Did I do the right thing? Is there a way I can tell my app to accept more
2005 Dec 23
6
Agile book - test error
Hi all, I get an error when testing the "store_controller_test.rb" The troublesome line is in the test below: def test_add_to_cart get :add_to_cart, :id => @version_control_book.id <<< cart = session[:cart] assert_equal @version_control_book.price, cart.total_price assert_redirected_to :action => ''display_cart'' follow_redirect
2007 Apr 19
5
Best practice thoughts: Model helpers, mocks
Hello! I''m pretty new to unit testing, and have only been using RSpec for a few weeks. I found that for my controller specs, my setup methods were getting very long building mocks/stubs for all the model objects I needed to work with. I''ve started creating helpers like the following for each of my models. The "min_" methods are short for "minimum", and
2005 Dec 19
2
Advanced search/filter use cases
I''ve been working on an application lately that has a lot of advanced search and filtering functionality (with ranges and substring searches for each attribute). Despite being a pretty common use case, this isn''t supported particularly well by any framework I''ve used, including Rails. I''d like to fix that. :) Right now, my major pet peeves are: 1. Long,
2005 Dec 21
13
Too many login generators?
there is a blog about it http://www.realityforge.org/articles/2005/11/12/aaa_in_rails There are so many Authentication/Authorization/Auditing generators now, just like the situation in java''s world, Too many components doing the samething just make me confusion. Why not add one to rails core lib and everybody can extend it for their...
2006 Jan 19
2
Easy way to handle form input without a model class?
I have a couple forms that I''d like to be able to validate and automatically populate, but it shouldn''t be based on AR. In fact I often have a bunch of small forms that I can''t really justify writing a whole new model class for anyway. I''d like to validate the form input, and then use rails helpers to automatically populate the form if validations fail.
2006 Apr 05
0
Loading Binary Data into Rails Fixtures
Hi, I don''t know if this was obvious to anyone else but for ages I never knew how to load binary data into fixtures (like images) except via separate rake tasks. I just figured it out so I figured I would share info with people - it is written up at; http://www.realityforge.org/articles/2006/04/06/loading-binary-data-into-rails-fixtures -- Cheers, Peter Donald
2006 Apr 17
0
Validation schemes for model objects that are not yet saved
...e specific, I do a lot of validation that is related to one attribute on this model. I would like to do some validation on it but take advantage of something akin to ActiveValidation. I''ve read through this http://www.ruby-forum.com/topic/1689#1210 which referenced this: http://www.realityforge.org/articles/2005/12/02/validations-for-non-activerecord-model-objects and I just wondered if anyone had come up with another scheme for handling validation for "partially constructed" model objects that they would be willing to share. I think I can probably just create another non-da...
2006 Mar 02
1
Forms with and without Models and Error Handling
Hi, I currently programming a delicious clone to understand ruby on rails. The problem I''ve got is that I prefill a form (form without models) without a database connection and then save it into the database. For validation i am using the validation helper methods. My Problem is that i don''t know how I get the error hash from the helper method validates... etc. because I
2006 Feb 11
0
show table
code snippet: ActiveRecord::Base.connection. select_values(''show tables'').each do |table_name| Came across : http://www.realityforge.org/articles/category/rails/ http://www.bigbold.com/snippets/tag/rails Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060211/3d...
2005 Dec 22
1
[NEWB] How to access database.yml parameters in a controller
Hi, Are the active database.yaml attributes for the current environment (dev, prod, test) available inside a controler ? adapter, host, db, socks, etc. AFIK Class#connection don''t give back theses infos. Thanks
2005 Dec 22
2
routes and url_for
Hi, All. I try to relocate controllers. Admin space controlers moved to /app/controllers/admin and user space controllers to /app/controllers/user In routes.rb I use map.connect ''search'', :controller => ''user/search'' that correct I see. But when I want to use start_form_tag or simply url_for, that used in start_form_tag, I do not know how generate url
2005 Dec 30
2
How to abort program flow after a redirect?
I''m developing an authorization plug-in which adds a permit keyword, so you can do things like: class FooController < ApplicationController permit "member" def edit permit "owner of :document", :document => Document.find(params[:id]) # stuff to edit.. end end I''ve got it mostly working, but if the permit in #edit fails, a redirection