search for: paulbarri

Displaying 20 results from an estimated 35 matches for "paulbarri".

Did you mean: paulbarry
2006 Jan 14
6
Error installing Rails/FastCGI/Apache2
Trying to install rails/fcgi/apache2. Following these instructions: http://xmlareas.com/ruby-rails-howto.html Using Fedora Core 4. I installed ruby and ruby-devel using apt-get. Everything under Adding FastCGI (optional) works fine up to the gem install fcgi part. Here is what happens: [root@paulbarry fcgi-2.4.0]# gem install fcgi -r -- -with-fcgi-lib=/usr/local/fcgi/lib
2006 Apr 04
4
How to read rails documentation
One of the criticism I have heard about rails is that the documentation is bad. I must admit I have a hard time trying to follow it and I wonder if anyone can shed some light on it for me. For example, I am looking at the schema.rb file generated and I noticed this line: create_table "accounts", :force => true do |t| I thought to myself, what does :force => true mean? So I
2006 Jan 22
23
calculate users age
i know it''s probably really simple, how do i work out someone''s age if i have their d.o.b. stored as a date in my db. cheers -- Posted via http://www.ruby-forum.com/.
2006 May 31
7
How do you create a controller & view to create a list of objects?
I''m trying to figure out how to design a view and controller to work with a simple collection. I have a Foo that has many Bars, so here''s what I did: $ ruby script/generate model Foo $ ruby script/generate model Bar (Uncomment t.column, :name: :string in foo and bar migrations) (Edit Foo.rb and Bar.rb, add has_many :bars to Foo, belongs_to :foo to Bar) $ rake db:migrate $ ruby
2006 Apr 04
2
loading data with migrations
Hello, I''m just taking a look at migrations, seems like a fantastic way to maintain the database. I am wonder if there is a way to maintain what I''ll call "reference data" along with the migrations. A lot of times in apps your have tables that have pretty static data, often used to generate select lists. Is there a way to insert the reference data into these tables
2006 Jan 17
2
Does anyone use RedCloth to allow end user input?
I was hoping to use RedCloth for textilize support to allow end users to enter textilized text (In blog comments, for example), but these bugs seem to make RedCloth unsuitable for that purpose: http://rubyforge.org/tracker/index.php?func=detail&aid=2989&group_id=216&atid=891 http://rubyforge.org/tracker/index.php?func=detail&aid=1779&group_id=216&atid=891
2006 Apr 28
2
Accessing fixtures from unit tests
I have set up some fixtures in test/fixtures/users.xml: # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html admin: id: 1 username: admin password: admin pbarry: id: 2 username: pbarry I have a unit test for my user model: require File.dirname(__FILE__) + ''/../test_helper'' class UserTest < Test::Unit::TestCase fixtures :users def
2006 May 07
2
label tag with errors?
I''d like to create a label tag that has a special css class if has errors. So Ideally, I''d like: <%= label(''object'',''property'',''Property'') %> To generate: <label for="object_property">Property</label> And if there are errors on object.property, generate this: <label
2006 Jan 09
5
Formatting timestamp objects
I want to print my timestamp objects in a specific format. I want to print a date like this: Sunday, January 8 2006 I don''t want it to print January 08. For the time, I want it to look like this: 9:08 pm Not 09:08 and lower case PM. I created these methods: def format_date(date) date.strftime("%A, %B #{date.day} #{date.year}") end def format_time(date) if
2008 Jul 01
6
validates_associated & foreign keys
Hi, I''m struggling to get the validates_associated to work as I think it should be. I''m using: JRuby 1.1 rails-2.0.2 activerecord-2.0.2 activerecord-jdbc-adapter-0.8.2 My tables in MySQL: CREATE TABLE area_codes ( id INT UNSIGNED auto_increment primary key ... ); CREATE TABLE markets ( id INT UNSIGNED auto_increment primary key, ... ); CREATE TABLE
2009 Nov 07
0
wrong argument type Mysql (expected Struct) running rake with Ruby 1.9 / Rails 2.3.3
I''m use Ruby 1.9 via rvm and Rails 2.3.3. I''m on OS X 10.5 and I have the mysql 2.8.1 gem installed. When I run rake on my rails app, I get the error "wrong argument type Mysql (expected Struct)". I can run the app fine with script/server and script/console fine. Is anyone else having this problem or know what might cause this problem? Here''s the stack
2006 Jan 14
7
Rails on Resin
Anyone figured out how to get rails/fastcgi to run on Resin. I assume it would be similar to PHP, which there are directions here: http://www.caucho.com/resin-3.0/thirdparty/php.xtp One thing that confuses me is that it wants a server address: <server-address>localhost:8002</server-address> Apparently you start the php process, like this: php -b 8002 And then the PHP process
2006 Jan 27
9
RedCloth Hard Breaks
Has anybody gotten :hard_breaks to work with RedCloth? I''m doing: self.body_html = RedCloth.new(self.body).to_html(:textile) which works, except that it doesn''t transform hard breaks to <br /> tags, which is really important for me. However, if I do: self.body_html = RedCloth.new(self.body, [ :hard_breaks ]).to_html(:textile) then it converts ALL breaks into <br
2008 Nov 03
1
concerned_with, and maybe require_dependency issues only when running specs?
Hi all, So in the interests of keeping a few areas of my code a bit under control, I''ve been investigating the concept of "concerned_with" as described here: http://paulbarry.com/articles/2008/08/30/concerned-with-skinny-controller-skinny-model Basically allowing me to have: /app/models/user.rb class User < ActiveRecord::Base concerned_with :something end
2006 Jun 19
1
AWDwR2: Loading data in migrations
The new chapter in Agile Web Development with Rails talks about using migrations to load data from fixtures. This is a great idea, I''ve wanted to do this. This allows you a good way to create sample data that you can use during development, testing or demoing of an application. My question is how do you keep it separated from the real data? For example, say you have a User and Account
2006 Apr 04
2
Pagination and Parent Conditions
Can I do any "fancy" conditionals when using the Pagination helper? The problem is that I want to be able to specify a conditional based on the criteria of a parent object. Here''s an example: Object A has_many Object B''s I want to paginate through 100 B''s but I *only* want it to return the ones who''s A.flag = true I poked around through the Wiki
2006 Jan 16
0
Lighttpd/FastCGI dispatch.fcgi processes
I have the fastcgi.server part of my lighttpd.conf like this: fastcgi.server = ( ".fcgi" => ( "test" => ( "socket" => "/tmp/test1.socket", "bin-path" => "/home/paulbarry/public/dispatch.fcgi", "min-procs" => 1, "max_procs" => 2 ) ) ) When I start
2006 Jan 17
2
update_attribute and validations
Just in case it saves someone else the several hours of insanity I just went through, update_attributes will not save unless the model validations are satisfied, but update_attribute (the singular form) will save the attribute to the database even if the model validations would fail! This appears to be a feature, not a bug (http://api.rubyonrails.com/classes/ActiveRecord/Base.html) although
2006 Jun 28
0
ActiveResource (was: 1.1.3 available.)
2006/6/28, Paul Barry <mail@paulbarry.com>: > Where can I find info about the "CRUD/resource-based features" that will be > in 1.2.0? In blogs. Especially about Railsconf and DHH''s keynotes. In trunk : http://dev.rubyonrails.org/browser/trunk/activeresource In DHH slides : Transcription of some slides from DHH''s talk at RubyKaigi 2006 (I suppose it must
2006 May 02
16
no one cares about i18n (was [OT]: Asking questions on this list)
Do most others in the community agree with this statement? It seems to me that i18n is: 1. Actually important to many people 2. Not really the difficult to implement in concept 3. Something that people like to point out about Rails to say it''s not ready foir "Enterprise" It seems to be that a big part of Rails is encouraging people to do things the "Right Way",