[Rails] Re: Rails routing

2009-03-22 Thread Chris Kottom
I would write the thing you're trying to do as: map.short_book_page ":book_id/:page_id", :controller => "books", :action => "my_action" However... Defining your route in this way will have the probably unintended effect of shortcircuiting your default routes (i.e. ":controller/:action"). If th

[Rails] [ANN] rspec-rails 1.2.2 Released

2009-03-22 Thread David Chelimsky
rspec-rails version 1.2.2 has been released! * * * * * Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.2 / 2009-03-22

[Rails] [ANN] rspec 1.2.2 Released

2009-03-22 Thread David Chelimsky
rspec version 1.2.2 has been released! * * * * Behaviour Driven Development for Ruby. Changes: ### Version 1.2.2 / 2009-03-22 Bug-fix release (fixes regression introduced in 1.2.1) * bug fix

[Rails] Re: Rake goes crazy on me!

2009-03-22 Thread Rob Biedenharn
On Mar 23, 2009, at 2:19 AM, Power One wrote: > By the way when I googled for this, I got no answer. Maybe I'm just > not > good with googling for ruby :(. I'm pretty sure I got what I want > from > a genius "Google" for other stuffs though, but not this time around! > > Any help will make m

[Rails] Re: GoogleMaps book and FCC ASR Database

2009-03-22 Thread Chris Kottom
http://wireless.fcc.gov/uls/data/complete/r_tower.zip seems to work for me. Maybe blocked from your location? On Sun, Mar 22, 2009 at 2:22 PM, Agustin Viñao < rails-mailing-l...@andreas-s.net> wrote: > > Hi, im reading the book GoogleMaps app with Rails and ajax, in the > chapter 5, i need to dow

[Rails] Re: Rake goes crazy on me!

2009-03-22 Thread Power One
By the way when I googled for this, I got no answer. Maybe I'm just not good with googling for ruby :(. I'm pretty sure I got what I want from a genius "Google" for other stuffs though, but not this time around! Any help will make my day! :) Thanks... Going to sleep for now, peace out! hehe

[Rails] Rake goes crazy on me!

2009-03-22 Thread Power One
OK, so I used ./scripts/generate to generate a model, and then I entered the db/migrate/ and edit 001.rb so I can populated the database. After I entered some ruby code to have the file 001xxx.rb to generate some columns for table in db later, then I do rake1.9 db:migrate to generate table and

[Rails] Re: Can`t connect to MySQL Database with Netbeans 6 for RoR ?

2009-03-22 Thread Aditya Mittal
This is a genuine question. I too am using a windows machine and mysql is properly installed and all that. I've resolved it after like 5 hours of confusion by simply moving down to the previous version: In environment.rb in your project change the version from 2.2.2 to 2.1.0: RAILS_

[Rails] InstantRails and new gems

2009-03-22 Thread Pierre Pierre
Folks, I'm not sure this is the best place to ask the following question, but someone might still know the answer. I currently can't install anything on this computer (hence no ruby interpreter), I thought about getting InstantRails with which you can open a console with ruby running. I also wan

[Rails] [ANN] rspec 1.2.1 Released

2009-03-22 Thread David Chelimsky
rspec version 1.2.1 has been released! * * * * Behaviour Driven Development for Ruby. Changes: ### Version 1.2.1 / 2009-03-22 This is a bug-fix release, recommended for anybody who has alread

[Rails] [ANN] rspec-rails 1.2.1 Released

2009-03-22 Thread David Chelimsky
rspec-rails version 1.2.1 has been released! * * * * * Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.1 / 2009-03-22

[Rails] Re: cannot set ENV['RAILS_RELATIVE_URL_ROOT']

2009-03-22 Thread Jeremy Kemper
On Thu, Feb 8, 2007 at 3:48 AM, fero wrote: > > i am on lighttpd now, and i cannot set > cannot set enviroment variable: > > i added this line to enviroment.rb, but it doesn not work!! > > ENV['RAILS_RELATIVE_URL_ROOT'] = 'something' > > links on my page are ok, but all links to images, styleshee

[Rails] Re: cannot set ENV['RAILS_RELATIVE_URL_ROOT']

2009-03-22 Thread Qian Jigui
fero wrote: > i am on lighttpd now, and i cannot set > cannot set enviroment variable: > > i added this line to enviroment.rb, but it doesn not work!! > > ENV['RAILS_RELATIVE_URL_ROOT'] = 'something' > > links on my page are ok, but all links to images, stylesheets etc are > broken, (because re

[Rails] Re: Rails 2.3 Nested models

2009-03-22 Thread JL Smith
This should get you going...also check out the links at the end under "Resources". http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ru

[Rails] Re: Time.parse and some weird defassage with timezone

2009-03-22 Thread Andres
On Feb 24, 10:49 am, Maurício Linhares wrote: > What happens if you do this: > > puts( Time.parse("2008-02-24 4 pm").utc ) > > Do you get the correct UTC time? > Brigado Mauricio for the replay, yep, this was on scraped data, ashamed to say that I wasn't checking its integrity, when i got the d

[Rails] Setting Session Options in Rails 2.3

2009-03-22 Thread TomRossi7
I'm trying to figure out how I should set my session options for Rails 2.3. In Rails 2.2: session :cookie_only => false, :only => :swf_upload In Rails 2.3, it looks like I need to use: request.session_options['cookie_only'] = false But how do I tell it that I only want that option on a sp

[Rails] Re: Failsafe errors since upgrading to 2.3

2009-03-22 Thread Philip Hallstrom
I had this happen to me recently and found this post to be useful. http://billkirtley.wordpress.com/2009/03/03/failsafe-handling-with-rails/ I don't think that will solve your problem though as it's particular to mongrel, but it should provide some framework to work from. My understanding is

[Rails] Re: Failsafe errors since upgrading to 2.3

2009-03-22 Thread Andrew
Certainly, it's on Ubuntu 8.04, using Passenger 2.1.2, and yes I changed the version number in environment.rb + ran that rake command. I commented out my config.log_level line so I can see when that error occurs, but it's popping up in random places (not just happening when a certain action gets c

[Rails] Re: Checking my has_many :through relationships

2009-03-22 Thread ericindc
I think you're entirely right. But I struggle to find a meaningful, yet natural-feeling name. But besides the name, it still feels a tad awkward having the join model. It feels unnecessary, though the additional attributes require it. Thanks for the response. On Mar 22, 3:48 pm, Frederick Che

[Rails] Re: Failsafe errors since upgrading to 2.3

2009-03-22 Thread Conrad Taylor
On Sun, Mar 22, 2009 at 2:45 PM, AtsoK wrote: > > Since upgrading to 2.3, this error shows up dozens of times a day, and > I have no idea what's causing it. Anyone have any ideas? > > [ snip error listing ] So, please tell us about your configuration? When do these error occur exactly? If this

[Rails] Failsafe errors since upgrading to 2.3

2009-03-22 Thread AtsoK
Since upgrading to 2.3, this error shows up dozens of times a day, and I have no idea what's causing it. Anyone have any ideas? Processing ApplicationController#index (for 62.75.252.249 at 2009-03-22 13:23:08) [GET] Rendering /home/andrew/public_html/mysite/public/404.html (404 Not Found) /!\ FAI

[Rails] Rails 2.3 Nested models

2009-03-22 Thread JonMagic
I am moving an existing app from rails 2.2.2 to 2.3.2, and really like the idea of the new nested model implementation, but I'm having some issues. Has anyone written a good comprehensive howto for the new nested model stuff in Rails 2.3? --~--~-~--~~~---~--~~ You

[Rails] Re: validation for a non active record input field

2009-03-22 Thread pepe
Hi there, I've never done something like that but I can imagine you could do the validation in your controller. When the action is invoked you can check the values received in the params hash and act accordingly. Pepe On Mar 21, 12:42 pm, Rails List wrote: > not even a single person implemente

[Rails] DhtmlCalendarHelper

2009-03-22 Thread Herman Müller
Hi RoR community, for my webapp I need the german date format. To display the german date format like 31.12.2009, I implemented in the environment.rb following: ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!( :default => ' %d.%m.%Y ' ) If I use the DhtmlCalendarHelper

[Rails] Re: Checking my has_many :through relationships

2009-03-22 Thread Frederick Cheung
On Mar 22, 6:08 pm, ericindc wrote: > > I think this is right, it just feels odd initially building the middle > layer model.  My brain wants to just say Cubicle has_many :printers > given that the Printer model is already defined and have Rails just > know, sort of like HABTM, to look for the

[Rails] Re: ApplicationHelper::WillPaginate (NameError)

2009-03-22 Thread Frederick Cheung
On Mar 22, 6:19 pm, Fresh Mix wrote: > Help? Where you put require 'will_paginate' in environment.rb may be relevant. Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to t

[Rails] Re: Rails making it tougher for newbies?

2009-03-22 Thread Hugh Themm
Hi there, I know it can be frustrating, even for those of us that have been in it for a while. (freezing the environment is a real chore)/ My suggesting is to forgo the print books and go straight to peepcode.com and the pragmatic programmers(http://www.pragprog.com/ titles/rails3/agile-web-deve

[Rails] Re: before_filter on Models

2009-03-22 Thread Frederick Cheung
On Mar 22, 7:28 pm, Sergio Sergio wrote: > Hello everyone, is there a way to do something like after_filter on models ? > I would like to do something after one method in the model is executed, I > don't want to place that code in the model's method, I would like to keep > them in different met

[Rails] Re: actionmailer issues...any experts?

2009-03-22 Thread Frederick Cheung
On Mar 22, 6:54 pm, tony wrote: > What does SPF mean?  No when I use mail -s, the email is sent from > u...@ip.address > When you send an email from f...@bar.com the mail server on the other end can lookup the SPF record for the domain bar.com (this info is part of the DNS records for bar.com).

[Rails] Re: How does view know about instance vars set in controller?

2009-03-22 Thread Frederick Cheung
On Mar 22, 6:31 pm, Fernando Perez wrote: > Hi, > > I know that the AWDWR says to believe in magic and to not spend Xmas > with people asking this question, but really how does it work under the > hood? > > I was looking at the source code of crummy, and it seems that > instance_variable_set an

[Rails] Logging time in minutes and seconds

2009-03-22 Thread MartOn
Hello Anybody know a nice plug-in or function/helper to store time as double, but from user interface, show it as X min Y seconds and also in the input form, be able to write 12:03 to write 12 minutes and 3 seconds. /MartOn --~--~-~--~~~---~--~~ You received this

[Rails] before_filter on Models

2009-03-22 Thread Sergio Sergio
Hello everyone, is there a way to do something like after_filter on models ? I would like to do something after one method in the model is executed, I don't want to place that code in the model's method, I would like to keep them in different methods, is there a way to do this ? something like thi

[Rails] Re: actionmailer issues...any experts?

2009-03-22 Thread tony
What does SPF mean? No when I use mail -s, the email is sent from u...@ip.address On Mar 20, 11:34 am, Frederick Cheung wrote: > On 20 Mar 2009, at 18:16, tony wrote: > > > > > I have a rails app that can send emails to gmail, yahoo accounts.  But > > when it comes to more obscure accounts like

[Rails] Re: Problem running autotest in rails 2.3

2009-03-22 Thread David Chelimsky
On Mar 21, 11:58 pm, Phor Gruber wrote: > People, > > I'm trying to run autotest on rails 2.3 > > I get a NoMethodError. > > Here is what I see: > > Sat Mar 21 20:47 /b/tmp/myfc23 maco$ > Sat Mar 21 20:47 /b/tmp/myfc23 maco$ autotest > loading autotest/rails_rspec > ./vendor/plugins/rspec/lib/a

[Rails] How does view know about instance vars set in controller?

2009-03-22 Thread Fernando Perez
Hi, I know that the AWDWR says to believe in magic and to not spend Xmas with people asking this question, but really how does it work under the hood? I was looking at the source code of crummy, and it seems that instance_variable_set and instance_variable_get may be part of the answer. Is there

[Rails] Re: debugger seems broken with Rails 2.3.2

2009-03-22 Thread Fernando Perez
Matt Jones wrote: > Did that *ever* work? Development mode reloading only works between > requests. Ruby-debug may also be caching its own copy of the source > somewhere. I think it happens when I open another terminal and use script/console. Well I wasn't able to clearly identify the cause. An

[Rails] Re: ApplicationHelper::WillPaginate (NameError)

2009-03-22 Thread Fresh Mix
Help? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from

[Rails] Checking my has_many :through relationships

2009-03-22 Thread ericindc
I have a Cubicle model that will have many Printers, Phones, whatever. In the past, HABTM has sufficied, but each of the joins will need the capability to store additional attributes inside of the respective table. From what I've read, this is only a feature of using a join model -- has_many :th

[Rails] Re: debugger seems broken with Rails 2.3.2

2009-03-22 Thread Matt Jones
Did that *ever* work? Development mode reloading only works between requests. Ruby-debug may also be caching its own copy of the source somewhere. --Matt Jones On Mar 21, 3:58 pm, Fernando Perez wrote: > Fernando Perez wrote: > > With Rails 2.3.2 and ruby-debug 0.10.3 very weird things are happ

[Rails] Re: Rails making it tougher for newbies?

2009-03-22 Thread Bob O
This is another really good first rails book. it covers some really core concepts. This will help the other "deeper" books easier to get into. http://www.headfirstlabs.com/books/hfrails/ I have spent the last year learing and developing in Rails and Zend (php) and i wish i had this book a year a

[Rails] Re: how to redirect_to the index.html page

2009-03-22 Thread James Byrne
Paul Reitz wrote: > I'm having a similar problem that none of these solutions will work for. > I understand you can redirect to a URL, the problem is - while I'm > developing my app I want to redirect to 'http://127.0.0.1:3000' but > after I deploy it I want it to redirect to something like >

[Rails] Re: Rails 2.3.2 + Lighttpd

2009-03-22 Thread Fresh Mix
> I don't particularly see why you would want to stay so current with > your rails version whilst using what is considered aging/under > performing deployment method.. I need Rails 2.2 + Rails 2.3 + PHP + Perl support on web server. And Lighttpd was simples way to make it all work together. I ca

[Rails] Re: how to redirect_to the index.html page

2009-03-22 Thread Frederick Cheung
On Mar 22, 2:18 pm, Paul Reitz wrote: > I'm having a similar problem that none of these solutions will work for. > I understand you can redirect to a URL, the problem is - while I'm > developing my app I want to redirect to 'http://127.0.0.1:3000'but > after I deploy it I want it to redirect to

[Rails] Re: populating database outside of applicaiton

2009-03-22 Thread alberto
You can use a background process that runs independently of your web listeners. You can use something like Background DRB or some other background daemon. From there you can call any of your methods in your application to populate the appropriate tables. --~--~-~--~~~-

[Rails] Re: how to redirect_to the index.html page

2009-03-22 Thread Paul Reitz
I'm having a similar problem that none of these solutions will work for. I understand you can redirect to a URL, the problem is - while I'm developing my app I want to redirect to 'http://127.0.0.1:3000' but after I deploy it I want it to redirect to something like 'http://app.somedomain.com'.

[Rails] [ANN] Ruby-GetText-Package-2.0.0

2009-03-22 Thread Masao Mutoh
Hi, Ruby-GetText-Package-2.0.0 is now available. Ruby-GetText-Package now separate 2 base libraries and 3 libraries which support Ruby on Rails 2.3.2. For all libraries/applications: * locale - Management Locale IDs * gettext - Message localizations For Ruby on Rails: * locale_rails - Rails su

[Rails] GoogleMaps book and FCC ASR Database

2009-03-22 Thread Agustin Viñao
Hi, im reading the book GoogleMaps app with Rails and ajax, in the chapter 5, i need to download the FCC ASR Database (http://wireless.fcc.gov/uls/data/complete/r_tower.zip) but the link is broken. Do you know where im donwload this file? Google don't give me any valid location.- PD. sorry my e

[Rails] Re: Clean way to handle prices

2009-03-22 Thread Fernando Perez
> or however you want to manually manage the accessors, just make sure > when overloading you use the read_attribute, and write_attribute That's exactly what I was looking for! I couldn't find these methods in railsbrain because they are private, therefore no documentation is generated except i

[Rails] Re: Rails routing

2009-03-22 Thread ruby...@ymail.com
On 22 Mar., 11:16, "Paul A." wrote: > Hi, everybody > > Is there a way to simplify address path from: >  http://0.0.0.0:3000/books/3/pages/1 > to this format: >  http://0.0.0.0:3000/3/1 > > My current routes.rb looks like: > > ActionController::Routing::Routes.draw do |map| >   map.resources :b

[Rails] Re: Sending & Recieving Mail

2009-03-22 Thread ruby...@ymail.com
On 22 Mar., 04:55, Richard Schneeman wrote: > I've tried that, it doesn't work. I was successfully able to find a > workaround using an observer, but i would still think that this type of > action Should be possible. I think so too. Did you check your log to see if ActionMailer puts anything t

[Rails] Re: Upgrading 2.2 to 2.3: console broken, "uninitialized constant Module::ActiveSupport"

2009-03-22 Thread Henrik N
On Mar 22, 12:14 pm, Henrik N wrote: > Upgrading a Rails app from 2.2 to 2.3.2 (via 2.3.0). Got things > working in the browser, but script/console seems messed up in both > 2.3.0 and 2.3.2: > > $ script/console > Loading development environment (Rails 2.3.2) > /Library/Ruby/Gems/1.8/gems/rails-2

[Rails] Upgrading 2.2 to 2.3: console broken, "uninitialized constant Module::ActiveSupport"

2009-03-22 Thread Henrik N
Upgrading a Rails app from 2.2 to 2.3.2 (via 2.3.0). Got things working in the browser, but script/console seems messed up in both 2.3.0 and 2.3.2: $ script/console Loading development environment (Rails 2.3.2) /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:56:in `env':NameError: unin

[Rails] Re: not logged in in subdomain?

2009-03-22 Thread phil
This is still not working for us. we have: if RAILS_ENV == 'production' config.action_controller.session = { :session_key => '_site_session', :session_domain => '.site.com', :secret => 'x' } else config.action_controller.session = { :session_key =

[Rails] Re: RESTful routing in 2.3 breaks

2009-03-22 Thread ruby.freeman
the solutions is that now we have to set :method => :get in options, but not in :url hash. then it works --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email t

[Rails] Rails routing

2009-03-22 Thread Paul A.
Hi, everybody Is there a way to simplify address path from: http://0.0.0.0:3000/books/3/pages/1 to this format: http://0.0.0.0:3000/3/1 My current routes.rb looks like: ActionController::Routing::Routes.draw do |map| map.resources :books do |book| book.resources :pages end end Many

[Rails] populating database outside of applicaiton

2009-03-22 Thread Adam Akhtar
Im learning rails now and what id like to do is aggregate data from external sources on a daily basis into my database. Within my users can searhc and filter through that data to their hearts content. Assuming i can get this external data say via rss feeds or good old screen scraping what tools c

[Rails] Re: Rails making it tougher for newbies?

2009-03-22 Thread MaD
i can recommend this one for a good start: http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition DHH mentioned that it is completly 2.3 ready. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

[Rails] [Rails 2.3] named routes bug ?

2009-03-22 Thread Kpitn
Hi, I'm using this path : admin_gallery_photos_path(gallery,session_key => cookies[session_key], request_forgery_protection_token => form_authenticity_token) log show : Parameters: {"_my_session"=>"BAh7CToMdXNlcl9pZGkGOhBfY3NyZl90b2tlbiIxMHk2T3luai9qUW1QditVaFdKS1hWbDVHS2ZtWWZuNFdVQ3BWNWdYaFNWND

[Rails] Re: Clean way to handle prices

2009-03-22 Thread Jeremy Olliver
As someone else mentioned, wrapping this conversion to dollars makes it a lot easier to manage. The stack too deep problem in your overloading of price and price= should be able to be solved by using the direct accesors like so: def price cents_to_dollars(read_attribute(:price)) end def price

[Rails] Re: How to restart an app under Passenger

2009-03-22 Thread Colin Law
2009/3/22 Greg Donald > > On Sat, Mar 21, 2009 at 11:02 PM, avramd wrote: > > However I can't figure out how to trigger Passenger to > > realize that I've changed my code. > > > > Any ideas? > > > touch tmp/restart.txt > > On my system passenger seems to automatically restart the server if tmp/r

[Rails] Re: Instance variables in helpers?

2009-03-22 Thread MaD
maybe i misunderstand, but what i see is a helper-method in application_helper. i don't know how many times you call that method in one single view, but if you call it only once @rev is not yet set when you write it into your log file. does the method return your revision-number correctly? if so

[Rails] Re: Clean way to handle prices

2009-03-22 Thread MaD
james already mentioned the best way to do this, but if that doesn't match your requirements, just write your own helper-method. stuff like that is not done inside the controller. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

[Rails] Re: Instance variables in helpers?

2009-03-22 Thread James Cowlishaw
2009/3/20 ruby...@ymail.com > > > > On 20 Mar., 18:36, Lee D'oéjgi wrote: > > Hi, > > > > Can someone tell me why the following isn't setting an instance variable? > > Perhaps they can't be set/used in helpers? I have a revision_info method > in > > ApplicationHelper that returns the current SVN

[Rails] Re: Clean way to handle prices

2009-03-22 Thread James Cowlishaw
Fernando,I suggest you look at http://apidock.com/rails/ActionView/Helpers/NumberHelper/number_to_currency. Call the helper with value.to_f * / 100 James. 2009/3/22 Fernando Perez > > Hi, > > Currently I am storing my prices as cents. I have one major issue, it is > the way I convert this value

[Rails] Re: Models distance in terms of associations

2009-03-22 Thread Gabriele Tassoni
On 21 Mar, 19:58, Frederick Cheung wrote: > On Mar 21, 6:23 pm, Gabriele Tassoni > wrote: > > There's not something builtin (although it does sound like it would be > a relatively simple graph traversal exercise to produce something like > this (picking the 'best' path if there were multiple o