[Rails] Re: undefined method `each' for "":String

2010-03-31 Thread ES
As it turns out, I had declared that my main object class had many of another type of object (photos). In my object controller new method I had @object.photos.build But then in my form I only had one field for the photo object. It was trying to build the photo objects with just one string a

[Rails] Request format from jabber simple to openfire server

2010-03-31 Thread Karthikragunath Bhavani
Hi All, In order to enable chat functionality with gmail in my rails application i used "Jabber" and "xmpp4r/simple" and finished the chat functionality well and fine. Now i was asked to enable the chat functionality with other services like "MSN","Yahoo","AOL" etc which requires a third party s

[Rails] Re: Dependency warning found on fresh rails 2.3.5 installati

2010-03-31 Thread ct9a
I ran an fgrep on "vendor_requirements" and it's all in the vendor directory. I am not specifying it in my app files. This is messed up c...@rollcage:~/projects/myApp $ fgrep -Rn version_requirements * vendor/gems/authlogic-2.1.1/.specification:19: version_requirements: ! ruby/object:Gem::Requi

[Rails] Loading a library before ActiveSupport

2010-03-31 Thread trans
Is there any means for having an external library loaded before ActiveSupport is loaded when starting up a Rails app? -- 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-t...@googlegroups.com.

[Rails] Re: undefined method `each' for "":String

2010-03-31 Thread mikrogroove
On Mar 31, 7:21 pm, ES wrote: > I implemented creating an object within another object according to > this Railscast: > > http://railscasts.com/episodes/74-complex-forms-part-2 > > but I'm getting this error after I submit.  Any ideas? > > undefined method `each' for "":String Sounds like you hav

[Rails] Re: WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread mikrogroove
On Apr 1, 12:09 am, mikrogroove wrote: > On Mar 31, 4:12 pm, Cogaidhean wrote: > > > Other than you not being on the latest RVM the environment looks > > healthy from RVM's standpoint. > > Thanks for looking at this Wayne, it's pretty weird since everything > else seems perfectly ok - I'm at a lo

[Rails] Re: unbalanced brackets error

2010-03-31 Thread g_f
Since you didn't say what the problem was, I'll take a shot at it. It looks like HAML to me. If it is, it looks like you should use the :javascript filter instead of trying to build a

[Rails] Re: unbalanced brackets error

2010-03-31 Thread John Merlino
Nevermind, I figured it out. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

Re: [Rails] undefined method `each' for "":String

2010-03-31 Thread Rick DeNatale
On Wed, Mar 31, 2010 at 2:21 PM, ES wrote: > I implemented creating an object within another object according to > this Railscast: > > http://railscasts.com/episodes/74-complex-forms-part-2 > > but I'm getting this error after I submit.  Any ideas? > > undefined method `each' for "":String I'm gu

[Rails] Re: WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread mikrogroove
On Mar 31, 4:12 pm, Cogaidhean wrote: > Other than you not being on the latest RVM the environment looks > healthy from RVM's standpoint. Thanks for looking at this Wayne, it's pretty weird since everything else seems perfectly ok - I'm at a loss as to what to do to move forward and get things wo

[Rails] Re: unbalanced brackets error

2010-03-31 Thread John Merlino
This gives me illegal nesting within plain text: %head %script{:type => "text/javascript"} $(document).ready(function() { <%= yield :javascripts %> }); %meta{"http-equiv" => "content-type", :content => "text/html;charset=UTF-8"} -- Posted via http://www.ruby-forum.com

[Rails] unbalanced brackets error

2010-03-31 Thread John Merlino
I'm getting unbalanced brackets and illegal nesting errors with this line of code: %html{ :lang => 'en', 'xml:lang' => 'en', :xmlns => 'http://www.w3.org/1999/xhtml' } %head %script{:type => "text/javascript" $(document).ready(function() { <%= yield :javascripts %> }}); %

[Rails] Date Conversion

2010-03-31 Thread Sav
Can someone help me format the following date into a db-friendly datetime value? Here is the date I get from an XML file... xmldate = "2010-03-31T07:47:46 -500" But xmldate.to_datetime isn't handling the timezone... 2010-03-31T07:47:46+00:00 Any ideas how I get to this?... 2010-03-31T07:47:46-05

[Rails] ActiveRecord's design allowing silent failure of object saves in associations.

2010-03-31 Thread Joe Smith
I take issue with the faxt that in some cases ActiveRecord may automatically save records using "save" rather than "save!". Specifically, this is when assigning an object to a "has_one" relation, or adding an object to the collection vreated by the remaining "has_*" associations. The automatic

[Rails] Re: module loading issue

2010-03-31 Thread Frederick Cheung
On Mar 31, 8:20 pm, Me wrote: > Trying to keep things organized I created a directory under app called > modules.  In my env file I did what I did for my other directories: > > config.load_paths += Dir[ "#{RAILS_ROOT}/app/modules/**" ] > > Here is the top of my module: > > module Sanitize >   mo

[Rails] Re: Intermediate level tutorials

2010-03-31 Thread Rajiv
On Mar 31, 1:08 pm, IanJ wrote: > Hi > I'm hoping somebody can suggest an intermediate level tutorial or > point me in the right direction. Well, have a try at http://paperc.de where you can read whole books online for free. It's a German site, but has a lot of english titles. Just search for rub

[Rails] Re: Catch the browser close event

2010-03-31 Thread Harp Oon
bill walton wrote: > Hello Hiro, > > On Mon, 2009-03-02 at 08:04 -0800, Hiro wrote: > >> Is there a way to catch the browser close event? > > There is no reliable way to do this. > >> I want it to end the users session, because if the >> user close the browser and try to sign in, I get the >>

[Rails] Re: RMagick, ImageMagick, Passenger and Dreamhost

2010-03-31 Thread Keber Flores
I had the same problem on Ubuntu, and $sudo apt-get install librmagick-ruby1.8 did the trick for me. Hope this helps anybody. -- 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 gro

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-03-31 Thread Heinz Strunk
Gudleik Rasch wrote: > I've been struggling with the same issue a few times, and the solution > that worked for me was to use a different mysql driver: ruby-mysql > > # in config/environment.rb: > config.gem 'ruby-mysql' > > # or in Gemfile: > gem 'ruby-mysql' > > The encoding must also be set i

[Rails] Re: unitialized constant

2010-03-31 Thread John Merlino
David wrote: > Did you run the rake task after you installed the plugin? Yeah, I ran rake highcharts_rails:install and then rake db:migrate in console, I get this: >> HighChart NameError: uninitialized constant HighChart from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/

[Rails] Re: Advice on Search Design

2010-03-31 Thread Chris Hickman
I researched searchlogic prior to posting and unless I am missing something I don't see how it would get around something like this: if a,b & c but not d ... elsif a & b but not c & d elsif a and not b,c & d I did see something construct a mysql query, based on something like: query = ""

Re: [Rails] undefined method `each' for "":String

2010-03-31 Thread Colin Law
On 31 March 2010 19:21, ES wrote: > I implemented creating an object within another object according to > this Railscast: > > http://railscasts.com/episodes/74-complex-forms-part-2 > > but I'm getting this error after I submit.  Any ideas? > > undefined method `each' for "":String I think you may

Re: [Rails] Advice on Search Design

2010-03-31 Thread Jamey Cribbs
Google for "searchlogic". It's a rails plugin that makes stuff like this very easy to do. Jamey On Wed, Mar 31, 2010 at 2:42 PM, Chris Hickman wrote: > I've been having problems submitting a question to this forum so sorry > in advance if this is a repeat. > > I am not looking for code exampl

[Rails] module loading issue

2010-03-31 Thread Me
Trying to keep things organized I created a directory under app called modules. In my env file I did what I did for my other directories: config.load_paths += Dir[ "#{RAILS_ROOT}/app/modules/**" ] Here is the top of my module: module Sanitize module Html def self.included(base) base

[Rails] Re: Re: Re: Updating records

2010-03-31 Thread Stephen None
Colin Law wrote: > On 30 March 2010 19:20, Stephen None wrote: >> � �...@book.update_attributes(params[:book]) >> >> Processing BooksController#update (for 10.0.1.65 at 2010-03-30 14:01:07) >> [POST] >> �Parameters: {"commit"=>"Update", "action"=>"update", >> "authenticity_token"=>"vq6j9DJ57+AP4kb

[Rails] Rails3 parameters in routes

2010-03-31 Thread H.J. Blok
In Rails 2 I was able to specify extra parameters within a route, like this: map.login "login", :controller => "user_sessions", :action => "new", :tag_index => true The tag_index would be available in the controller via params[:tag_index]. I've searched to find a simular solution within Rails 3, b

[Rails] Re: New to cacheing

2010-03-31 Thread Jeremy Woertink
Jeremy Woertink wrote: > David wrote: >> Have you added the sweeper to your list of observers in config/ >> environment.rb? > > Actually, I had not. I had another sweeper, and my user observer in > there. I will try that out, and post back what happens :) fail :( config.active_record.observers

[Rails] Re: New to cacheing

2010-03-31 Thread Jeremy Woertink
David wrote: > Have you added the sweeper to your list of observers in config/ > environment.rb? Actually, I had not. I had another sweeper, and my user observer in there. I will try that out, and post back what happens :) -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: Firebug Console window presents no Command line (>>>>)

2010-03-31 Thread Jeremy Woertink
RichardOnRails wrote: > This topic hasn't garnered any interest, so I'm abandoning my attempts > to fix the installed version and will re-install. So this thread is > closed as far as I'm concerned. > > On Mar 30, 8:26�pm, RichardOnRails lol, well not exactly rails related, but my guess is that

[Rails] Re: New to cacheing

2010-03-31 Thread David
Have you added the sweeper to your list of observers in config/ environment.rb? On Mar 31, 2:43 pm, Jeremy Woertink wrote: > Another odd thing maybe someone can clear up for me. > > In my sweepers I currently have: > > def expire_cache >   expire_action root_path > end > > but my cache isn't bein

[Rails] Re: undefined method `each' for "":String

2010-03-31 Thread Chris Hickman
I didn't look at the code but it appears you are trying to iterate over an empty string. -- 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-t...@goo

[Rails] Re: unitialized constant

2010-03-31 Thread David
Did you run the rake task after you installed the plugin? On Mar 31, 1:49 pm, John Merlino wrote: > I installed this pluginhttp://github.com/loudpixel/highcharts-rails > and I put this code in my controller: > >   def panels >     @ui_panels = Highchart.pie({ >     :chart => { >           :render

[Rails] Re: New to cacheing

2010-03-31 Thread Jeremy Woertink
Another odd thing maybe someone can clear up for me. In my sweepers I currently have: def expire_cache expire_action root_path end but my cache isn't being expired, so I figured I would put the route in manually def expire_cache expire_action :controller => 'site', :action => 'index' end

[Rails] Advice on Search Design

2010-03-31 Thread Chris Hickman
I've been having problems submitting a question to this forum so sorry in advance if this is a repeat. I am not looking for code examples, just a pointer in the right direction as far as design. I am trying to do a search based on information form 4 select boxes. None of the select boxes are man

[Rails] Re: object with many paperclip photos

2010-03-31 Thread Marcin Seroczynski
It should work but I would recommend using accepts_nested_attributes_for :image. Few screencasts: http://railscasts.com/episodes/196-nested-model-form-part-1 http://railscasts.com/episodes/197-nested-model-form-part-2 Best, Martin On Mar 31, 5:22 pm, Jeremy Woertink wrote: > ES wrote: > > I h

[Rails] undefined method `each' for "":String

2010-03-31 Thread ES
I implemented creating an object within another object according to this Railscast: http://railscasts.com/episodes/74-complex-forms-part-2 but I'm getting this error after I submit. Any ideas? undefined method `each' for "":String -- You received this message because you are subscribed to the

[Rails] Re: unitialized constant

2010-03-31 Thread Jeremy Woertink
> uninitialized constant DashboardController::Highchart > > Any suggestions? thanks. Are you able to go into the console and just type Highchart ? See if it's actually getting loaded into your app. If so, have you tried using the scope operator :: in front of it? ~Jeremy -- Posted via http://

[Rails] Re: Using Prawn in Rails 2.3.5

2010-03-31 Thread Jeremy Woertink
Ok, I had a lot of issues with this too, so I will just put all the steps I used to get it to work. #SETUP #though I'm sure bundler would be better for this Installed Prawn gem config.gem 'prawn', :version => '0.6.3' Installed Prawnto plugin ./script/plugin install git://github.com/thorny-sun/pr

[Rails] unitialized constant

2010-03-31 Thread John Merlino
I installed this plugin http://github.com/loudpixel/highcharts-rails and I put this code in my controller: def panels @ui_panels = Highchart.pie({ :chart => { :renderTo => "pie-chart-container", :margin => [50, 30, 0, 30] }, :credits => { :en

Re: [Rails] continue save after before_update observer

2010-03-31 Thread Hassan Schroeder
On Wed, Mar 31, 2010 at 4:21 AM, Joshua Partogi wrote: > This is what I wrote but it caused stack level too deep error: > > class FeatureObserver < ActiveRecord::Observer > def before_update(feature) >    feature.send(:save) > end > end :save precedes :update, so you've just created an infinite

[Rails] Re: Ruby in javascript

2010-03-31 Thread Jeremy Woertink
Hemant Bhargava wrote: > Hey Champs.. > > Can we write some ruby code into javascript ? > > Can you guys light me? you can make a main_scripts.js.erb inside one of your views then you can mix in ruby and JS together. The ruby will be processed first, and then made into a static js file, then y

Re: [Rails] any body can help me ?? why is this happen??

2010-03-31 Thread anton effendi
Thank you all I found why that happen... On Wed, Mar 31, 2010 at 11:39 PM, Jeffrey L. Taylor wrote: > Quoting anton effendi : > > Hii All > > > > I use ruby 1.8.7 > > I run irb and type: > > > > a = (0.29 * 100).to_i > > > > the result is 28 > > Here's why: > > irb(main):008:0> '%0.16f' % (0.29

[Rails] Re: undefined method error

2010-03-31 Thread Jeremy Woertink
Gautam wrote: > Thanks for your kind reply. > Here is the code of my routes.rb file > Please suggest corrections, if any... > >map.resources :notices >map.resources :users, :has_many => :notices >map.resource :session > > map.connect ':controller/:action/:id' > map.connect ':contr

[Rails] New to cacheing

2010-03-31 Thread Jeremy Woertink
Ok, So, I'm a bad developer and have never used any sort of cacheing before. I decided it's time I step up and I threw in some memcached magic. I'm still pretty new to all this, so I'm confused on how some things work. I've watched the railscast on cacheing, and gone through many tutorials. So, th

[Rails] Re: Localize doesn't work

2010-03-31 Thread Heinz Strunk
No, unfortunately not. Anyone else an idea? -- 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-t...@googlegroups.com. To unsubscribe from this group,

Re: [Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Hassan Schroeder
On Wed, Mar 31, 2010 at 10:02 AM, Kyle Drake made a major leap towards irrelevance, writing: > It's not April 1st yet, fix your clock. Erm, actually it *is* April 1st in some time zones :-) -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You recei

[Rails] Re: undefined local variable or method `requ est'—in test

2010-03-31 Thread elliottg
Any thoughts on this one guys? Thanks On Mar 30, 5:03 pm, elliottg wrote: > I am working on a small gem patch... The code in question is in a > module within /lib. I am calling request.env['HTTP_REFERER'] and > getting the desired results as implementation in the dev env. > > However, when I run

[Rails] Re: Re: Problem saving object

2010-03-31 Thread Jeremy Woertink
Colin Law wrote: > On 31 March 2010 16:33, Jeremy Woertink wrote: >> l.name = "test" > a <=> b > 5 <=> 4 >> >> Yeah, that much I'm certain of. The only thing I don't know is maybe if >> cache-money does something with that when trying to save an object and >> throwing it into cache. >>

Re: [Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Kyle Drake
It's not April 1st yet, fix your clock. -Kyle -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubsc

Re: [Rails] any body can help me ?? why is this happen??

2010-03-31 Thread Jeffrey L. Taylor
Quoting anton effendi : > Hii All > > I use ruby 1.8.7 > I run irb and type: > > a = (0.29 * 100).to_i > > the result is 28 Here's why: irb(main):008:0> '%0.16f' % (0.29 * 100) => "28.9964" Most decimal fractions cannot be represented exactly in binary. If you need them to behave

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Jules Copeland
Frederick Cheung wrote: > On Mar 31, 2:38�pm, Robert Walker wrote: >> a lot of people that also have trouble with this abstraction and find >> algebra difficult to grasp. That does not mean that math instructors >> should stop using x, y and z as abstract placeholders to unknown values >> in a equ

[Rails] Re: undefined method `abc_notice_path' for #

2010-03-31 Thread Frederick Cheung
On Mar 31, 4:40 pm, Gautam wrote: > Thanks for your kind reply. > Here is the code of my routes.rb file > Please suggest corrections, if any... > Take a look at http://guides.rubyonrails.org/routing.html#adding-more-restful-actions Fred >    map.resources :notices >    map.resources :users,

[Rails] Retrieve redirect URLs from an URL

2010-03-31 Thread Tom Pett
For a project I am currently working on I am looking for a solution that gives me an ordened list of all the URLs that are in a redirect chain. Lets say I have an URL x, clicking this in a normal browser would redirect to y, which would redirect me to z; my final destination. Having just URL x, h

Re: [Rails] Re: Re: Single Table Inheritance and .class problem

2010-03-31 Thread Colin Law
On 31 March 2010 16:41, Michael Pavling wrote: > On 31 March 2010 16:38, Tony Tony wrote: >> I was able to find the .class declaration via your search term. I guess >> I just didn't know that the "current_user" part was an object. I'm >> telling you - simple stuff. > > In Ruby, *everything* is an

[Rails] Re: Firebug Console window presents no Command line (>>>>)

2010-03-31 Thread RichardOnRails
This topic hasn't garnered any interest, so I'm abandoning my attempts to fix the installed version and will re-install. So this thread is closed as far as I'm concerned. On Mar 30, 8:26 pm, RichardOnRails wrote: > Hi, > > I'm running Rails 2.3.5, Ruby 1.8.6, WinXP-Pro/SP3, Firefox 3.6.2, > Fire

[Rails] Re: Re: Re: Single Table Inheritance and .class problem

2010-03-31 Thread Tony Tony
Not sure if the best part was identical answers or identical answer times! This forum kicks butt for putting up and helping us newbies out. Thank you guys. -Tony -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Aldric Giacomoni
Frederick Cheung wrote: > I also wouldn't try and be needlessly obtuse ie > > foos = Foo.all > bars = Bar.find ... > > rather than > > bar = Foo.all > baz = Bar.find ... You're right. Read the article I linked to. It talks about consistency. ;) -- Posted via http://www.ruby-forum.com/. -- Y

Re: [Rails] Re: Re: Single Table Inheritance and .class problem

2010-03-31 Thread Colin Law
On 31 March 2010 16:38, Tony Tony wrote: > Michael Pavling wrote: >> On 31 March 2010 15:36, Tony Tony wrote: >>> is there a place where I can learn this kind of thing simple thing? >> >> 'Fraid you've just gotta read the docs and remember as much as you can >> - and be suspicious! If something d

Re: [Rails] Re: Re: Single Table Inheritance and .class problem

2010-03-31 Thread Michael Pavling
On 31 March 2010 16:38, Tony Tony wrote: > I was able to find the .class declaration via your search term. I guess > I just didn't know that the "current_user" part was an object. I'm > telling you - simple stuff. In Ruby, *everything* is an object :-) -- You received this message because you a

[Rails] Re: undefined method `abc_notice_path' for #

2010-03-31 Thread Gautam
Thanks for your kind reply. Here is the code of my routes.rb file Please suggest corrections, if any... map.resources :notices map.resources :users, :has_many => :notices map.resource :session map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' map.c

Re: [Rails] Re: Problem saving object

2010-03-31 Thread Colin Law
On 31 March 2010 16:33, Jeremy Woertink wrote: > Hassan Schroeder wrote: >> On Tue, Mar 30, 2010 at 11:13 PM, Jeremy Woertink >> wrote: >> >>> NoMethodError (undefined method `<=>' for #): >>> >>> This happens even in the console when I try to create a new Listing >>> object and save it. >>>

[Rails] Re: undefined method error

2010-03-31 Thread Gautam
Thanks for your kind reply. Here is the code of my routes.rb file Please suggest corrections, if any... map.resources :notices map.resources :users, :has_many => :notices map.resource :session map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' map.c

[Rails] Re: Re: Single Table Inheritance and .class problem

2010-03-31 Thread Tony Tony
Michael Pavling wrote: > On 31 March 2010 15:36, Tony Tony wrote: >> is there a place where I can learn this kind of thing simple thing? > > 'Fraid you've just gotta read the docs and remember as much as you can > - and be suspicious! If something doesn't "work" then make sure all > your assumpti

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Frederick Cheung
On Mar 31, 2:38 pm, Robert Walker wrote: > Jules Copeland wrote: > > I just don't see the point in adding an extra layer of abstraction where > > there doesn't need to be one... > > I'd suggest picking another battle to fight. This one is arbitrary and > unimportant. It's not a battle you can wi

[Rails] Re: Problem saving object

2010-03-31 Thread Jeremy Woertink
Hassan Schroeder wrote: > On Tue, Mar 30, 2010 at 11:13 PM, Jeremy Woertink > wrote: > >> NoMethodError (undefined method `<=>' for #): >> >> This happens even in the console when I try to create a new Listing >> object and save it. >> l = Listing.new l.name = "test" l.save >> NoM

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Max Williams
Not to mention popular spinoffs like FooCamp and BarCamp. -- 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-t...@googlegroups.com. To unsubscribe fr

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Jeremy Woertink
Jules Copeland wrote: > Hi there, > > I'm teaching myself RoR, and I've found myself on this forum a fair few > times when looking for solutions to problems. > > I've also found many other sites with help forums and tutorials as well. > > This may seem like a petulant request, but please for the

Re: [Rails] Problem saving object

2010-03-31 Thread Hassan Schroeder
On Tue, Mar 30, 2010 at 11:13 PM, Jeremy Woertink wrote: > NoMethodError (undefined method `<=>' for #): > > This happens even in the console when I try to create a new Listing > object and save it. > >>> l = Listing.new >>> l.name = "test" >>> l.save > NoMethodError: undefined method `<=>' for #

[Rails] Re: object with many paperclip photos

2010-03-31 Thread Jeremy Woertink
ES wrote: > I have an object that has multiple photos uploaded to it, using the > paperclip plugin. I used a virtual attribute to have mutliple photos > in the form but I can't figure out how to get the image to save. It > works if I put <%= photo_form.file_field :image_file_name %> instead > of

[Rails] Re: WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread Cogaidhean
Other than you not being on the latest RVM the environment looks healthy from RVM's standpoint. -- 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-t...@googlegroups.com. To unsubscribe from th

Re: [Rails] Re: Single Table Inheritance and .class problem

2010-03-31 Thread Michael Pavling
On 31 March 2010 15:36, Tony Tony wrote: > is there a place where I can learn this kind of thing simple thing? 'Fraid you've just gotta read the docs and remember as much as you can - and be suspicious! If something doesn't "work" then make sure all your assumptions are correct - we normally assu

[Rails] Date format in Rails 3.0 using sqlite3

2010-03-31 Thread Guido Pinkas
Hi, I am new to Ruby and Rails, so I don't know if this is my fault, but maybe this is a bug in Rails (I'm using Rails 3.0 beta) which should be reported. I have following search statement: [code]events = CalendarEvent.find :all, :conditions => { :target_date => begin_date..end_date }[/code] whi

[Rails] Re: Single Table Inheritance and .class problem

2010-03-31 Thread Tony Tony
Michael Pavling wrote: > ".class" doesn't return a string, it returns a class... > > <%= content_tag(:li, link_to ("Products", productss_path)) if > current_user.class == Client %> > > but you might be better using "is_a?(base_class)" - depends what the > intention of your code is: > > <%= conte

Re: [Rails] Single Table Inheritance and .class problem

2010-03-31 Thread Michael Pavling
On 31 March 2010 15:21, Tony Tony wrote: > [code] > > <%= content_tag(:li, link_to ("Products", productss_path)) if > current_user.class == "Client" %> > > [/code] > > If I change "Client" in the above code to "User" it still doesn't work. > Is there some special case or usage required to handle >

[Rails] Re: Single Table Inheritance and .class problem

2010-03-31 Thread Tony Tony
Tony Tony wrote: > <%= content_tag(:li, link_to ("Products", productss_path)) if > current_user.class == "Client" %> Oops - typo in the above code: products_path not productss_path Any help is appreciated! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Single Table Inheritance and .class problem

2010-03-31 Thread Tony Tony
Hi all, I'm trying to do a condition in my application.html.erb where if a user is based off of a STI it has a "special" section in the navigation. The following code correctly prints out the user type (either User or Client) [code] <%= current_user.class if logged_in? %> [/code] However, wh

Re: [Rails] Re: looking for a coutdown solution

2010-03-31 Thread tom
pretty cool - is there a way to change the background color the closer the counter get to zero? thx On Wed, Mar 31, 2010 at 9:57 AM, Robert Walker wrote: > Remco Swoany wrote: > > Viola wrote: > >> http://keith-wood.name/countdown.html > >> I've used that before on my auction app. It workd pret

[Rails] Re: WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread mikrogroove
On Mar 31, 3:14 pm, mikrogroove wrote: > On Mar 31, 2:30 pm, Cogaidhean wrote: > > Also, you can check to see where the `rails` binary in your path is: > > ∴ which rails > > And see what ruby it is pointed at: > > ∴ head -n 1 $(which rails) > >   ~Wayne > > Many thanks for your suggestions. > > b

[Rails] Re: WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread mikrogroove
On Mar 31, 2:30 pm, Cogaidhean wrote: > Also, you can check to see where the `rails` binary in your path is: > > ∴ which rails > > And see what ruby it is pointed at: > > ∴ head -n 1 $(which rails) > >   ~Wayne Many thanks for your suggestions. b...@silicon:~/rails/TestProject$ head -n 1 $(which

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Robert Walker
Jules Copeland wrote: > Wow - I didn't realise this would be such an emotive topic! Think of it this way, you've stepped into the middle of a new culture with a strong tradition and history. There are unwritten and abstract rules unknown to you. It may seem perfectly reasonable to, for example,

[Rails] Re: regular expression

2010-03-31 Thread DmitryPush
This is very good tutorial (don't be upset its for perl, in ruby regexp works pretty the same) http://sunsite.ualberta.ca/Documentation/Misc/perl-5.6.1/pod/perlretut.html a. - [] - causing group of symbols, for eg /[bcr]at/ matches 'bat, 'cat', or 'rat' b. 1 - it's a first math ($1 in perl) c.

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Aldric Giacomoni
Jules Copeland wrote: > Hi there, > > I'm teaching myself RoR, and I've found myself on this forum a fair few > times when looking for solutions to problems. Hello, friend. Stay a while, and listen. (Diablo I) > > I've also found many other sites with help forums and tutorials as well. > > Thi

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Jules Copeland
Wow - I didn't realise this would be such an emotive topic! Thanks for all your replies. You all make good points. I didn't mean to come across as aggressive, so apologies to all those who have come to the defence of your beloved metasyntactic variables! (Thanks for teaching me a new piece of j

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Max Williams
Foo and Bar are the conceptual equivalent of using lorem ipsum when designing web pages. They're obviously not real things and so don't distract the user's attention away from the bigger picture. I do agree with some people here who've pointed out that as soon as variables hold something meani

[Rails] Re: looking for a coutdown solution

2010-03-31 Thread Robert Walker
Remco Swoany wrote: > Viola wrote: >> http://keith-wood.name/countdown.html >> I've used that before on my auction app. It workd pretty well. >> >> Viola > > I am a newbie...can you show me a code example how i can integrate this > script with a db-record What bit are you having difficulty unde

[Rails] Intermediate level tutorials

2010-03-31 Thread IanJ
Hi I'm hoping somebody can suggest an intermediate level tutorial or point me in the right direction. I'm a moderately experienced programmer (20 + years off and on) but I'm really struggling to get to grips with Web/RoR development. I'm reasonably familiar with Python and am getting familiar with

Re: [Rails] Stop using Foo Bar!

2010-03-31 Thread Peter Hickman
Part of the problem with more 'realistic' variable names is that some people will fixate on the names and fail to notice the general principal. For example def has_min_elements?(foo, bar) foo.size >= bar end might be harder to read for someone new but def bookshelf_has_at_least(bookshelf, numb

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Robert Walker
Jules Copeland wrote: > I just don't see the point in adding an extra layer of abstraction where > there doesn't need to be one... I'd suggest picking another battle to fight. This one is arbitrary and unimportant. It's not a battle you can win. You're focusing the blame for bad tutorial exampl

Re: [Rails] Stop using Foo Bar!

2010-03-31 Thread Gregory Seidman
On Wed, Mar 31, 2010 at 01:59:36PM +0200, Jules Copeland wrote: > I'm teaching myself RoR, and I've found myself on this forum a fair few > times when looking for solutions to problems. > > I've also found many other sites with help forums and tutorials as well. > > This may seem like a petulant

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Jules Copeland
> What you are describing is a scenario where the unknown values may not > be understood, and their values are rational and important. In these > scenarios good tutorials should avoid arbitrary references placeholders > and use more descriptive examples. > > Example: > > def foo > bar = 10 >

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Jules Copeland
I just don't see the point in adding an extra layer of abstraction where there doesn't need to be one... Most RoR evangelists go on about the readability of the code, so why spoil it by putting gibberish in? If you're going to the effort of trying to explain something to someone, why not make

[Rails] Re: WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread Cogaidhean
Also, you can check to see where the `rails` binary in your path is: ∴ which rails And see what ruby it is pointed at: ∴ head -n 1 $(which rails) ~Wayne -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send ema

[Rails] Re: WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread Cogaidhean
My bet is that you're environment doesn't have a `rails` binary and it is finding the first one it can, which happens to be 1.9.1. Does the same thing happen when you do: ∴ ./script/rails server Which will be sure to use the Rails version bundler bundled for the app with the current Ruby? You c

Re: [Rails] Stop using Foo Bar!

2010-03-31 Thread Hassan Schroeder
On Wed, Mar 31, 2010 at 4:59 AM, Jules Copeland wrote: > This may seem like a petulant request, but please for the love of all > things holy, can people stop using foo and bar in code demos and > tutorials please? c.f. -- Hassan Schroeder -

[Rails] Re: Stop using Foo Bar!

2010-03-31 Thread Robert Walker
Jules Copeland wrote: > Using Foo and Bar, just seems to add another level of mental processing > to go through before you can start grasping the concepts of what's being > explained. I'm sure this is not the answer you're looking for, but I'm afraid you're going to have to learn to live with foo

RE: [Rails] Stop using Foo Bar!

2010-03-31 Thread Joel Dezenzio
You can always use Voo, Doo, and Vlad. Metasyntactic variables are not meant to be creative or original though. They are simply meant to represent unknown variables. The common ones are Foo, Bar, and Baz. -- You received this message because you are subscribed to the Google Groups "Ruby on Ra

[Rails] utf-8 htmlentities,decode keeps switching to ascii-8bit

2010-03-31 Thread Kioko --
Hi there, it's not really rubyonrails but because it fits into the web-development I think I'm in the right forum. I'm trying to decode a string I read from an online xml-file and compare it to another, locally stored one. The locally stored string is: p localstring #=> "~St0rm€lite~" p localstri

Re: [Rails] Stop using Foo Bar!

2010-03-31 Thread Rimantas Liubertas
> Can I just ask for a little bit of imagination when giving examples > please? No. Longer version: programming is dealing with abstractions. If one want to learn programming then it is unavoidable. Or maybe I am just spoiled by those math teachers who used a and b, x, y and z instead of trying t

[Rails] WEBrick won't use correct Ruby version with RVM

2010-03-31 Thread mikrogroove
Ok, so I realised the hard way that 1.9.1 is just too close to the edge, especially in combination with Rails 3. I installed RVM and 1.8.7 which seems to work, but whenever I start WEBrick it still insists on using 1.9.1 which causes all sorts of strange problems and exceptions. b...@silicon:~/rai

[Rails] Re: undefined method error

2010-03-31 Thread Hitesh Rawal
Gautam wrote: > I am getting the following error when trying to link a method in a > view so that it can be called on that very object(id). > > undefined method `abc_notice_path' for # > > Extracted source (around line #25): > > 22: <%= link_to 'Edit', edit_notice_path(@notice) %> | > 23: <%= li

  1   2   >