[Rails] Re: How to add radio buttons?

2010-02-17 Thread Amal Kumar
Hi, %= radio_button :contact_preference, 0, :checked = true, :tabindex = 1 %Email %= radio_button :contact_preference, 1, :checked = false, :tabindex = 2 %Phone something like this will do. Thanks Amal On Feb 17, 10:57 am, Veena Jose li...@ruby-forum.com wrote: Hello friends, Can u plz

[Rails] ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Grary
Hi all, I've seen other messages on this problem, but I still can't get back to working with Rails after using MacPorts to install a recent version of ruby on my mac OS X 10.5 (ruby 1.8.7.) I'm getting: Rails requires RubyGems = 1.3.2. In fact, I am running rubygems 1.3.5. Here are some

Re:[Rails] Newbie RESTful routing problem, please help!

2010-02-17 Thread turbogears
your controller should be: class RecetasController ApplicationController def index end end not: class RecetaController ApplicationController 在2010-02-17?11:11:56,tuti?plain?li...@ruby-forum.com?写道: Hello,?on?my?last?post?a?few?weeks?ago,?all?who?replied?seemed?to?agree

[Rails] [JOBS] Technical Architect who can use tech to make a difference :-)!

2010-02-17 Thread Venkat
GiveIndia needs a bSenior Technologist: (based out of Mumbai)/b This is an excellent opportunity to use the latest web 2.0 tools and technologies to create change. The candidate will have the space and freedom to create several new online applications for use by GiveIndia itself, as well as by

[Rails] Set route for rails

2010-02-17 Thread mohit
How we can set routing for a controller book having function index I mean when i start the server it first run the index funxtion of a controller book like http://localhost:3000/ Thanks Mohit -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: Set route for rails

2010-02-17 Thread Sharagoz --
in configuration/routes.rb: map.root :controller = 'book' Delete index.html in the public folder -- 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

[Rails] Re: Re: Re: Update association on foreign key change?

2010-02-17 Thread Max Williams
Jim Tobin wrote: Wouldn't ActiveRecord Observer class do what you're looking for? Observer has the same problem as callbacks - you can only hook them into database transactions. I'm talking about the situation when you've changed something and go on to do some other things without saving yet.

Re: [Rails] Problem with file_field

2010-02-17 Thread Michael Pavling
On 17 February 2010 05:58, Greg Ma li...@ruby-forum.com wrote: Hi, I trying to do an upload form, bu the file_field doesnt seem to work as it should. I can't access the datafile properties... #form % form_for @student, :url = { :action = upload_file,:id=@student.id }, :multipart = true do

[Rails] Re: Re: Update association on foreign key change?

2010-02-17 Thread Max Williams
Greg Donald wrote: On Tue, Feb 16, 2010 at 7:04 PM, Greg Donald gdon...@gmail.com wrote: You can easily detect a foreign key change with a filter in the model: Or even better: http://www.railsapi.com/doc/rails-v2.3.5/classes/ActiveRecord/Callbacks.html -- Greg Donald destiney.com |

Re: [Rails] Re: Re: Re: Update association on foreign key change?

2010-02-17 Thread Michael Pavling
On 17 February 2010 09:15, Max Williams li...@ruby-forum.com wrote: Jim Tobin wrote: Wouldn't ActiveRecord Observer class do what you're looking for? Observer has the same problem as callbacks - you can only hook them into database transactions.  I'm talking about the situation when you've

Re: [Rails] Appending parameters to a link

2010-02-17 Thread Colin Law
On 17 February 2010 00:28, Philip Hallstrom phi...@pjkh.com wrote: Consider  link = url_for(:controller = signed_in,                :action = show, :id = user_info)  # = /signed_in/user_info to which I wish to add the either or both of the following  locale=en  nickname=ralph Is there

[Rails] Re: ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Frederick Cheung
On Feb 17, 3:05 am, Grary grary.sti...@gmail.com wrote: Hi all, I've seen other messages on this problem, but I still can't get back to working with Rails after using MacPorts to install a recent version of ruby on my mac OS X 10.5 (ruby 1.8.7.) I'm getting: Rails requires RubyGems =

[Rails] blog analysis

2010-02-17 Thread pitchu
I'm looking for an analysis tool for blogs. Is an application available? I need to find how many blogs were created after a date. thanks -- 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

[Rails] Re: Back button

2010-02-17 Thread Ralph Shnelvar
Anthony Franco wrote: Try: button_to Back, :back It does not have the same behavior. If I understand the documentation, :back uses the referrer field. Does Rails maintain a per window or per tab linked list of URLs? visited? I think this may be a bit more complicated than just using

[Rails] Re: Back button

2010-02-17 Thread Frederick Cheung
On Feb 17, 10:35 am, Ralph Shnelvar li...@ruby-forum.com wrote: Anthony Franco wrote: Try: button_to Back, :back It does not have the same behavior. If I understand the documentation, :back uses the referrer field. Does Rails maintain a per window or per tab linked list of URLs?

[Rails] Re: Active record validation Issue

2010-02-17 Thread Web Developer
Any solution to this I am stuck :-( -- 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,

[Rails] Re: Active record validation Issue

2010-02-17 Thread Frederick Cheung
On Feb 17, 11:16 am, Web Developer li...@ruby-forum.com wrote: Any solution to this I am stuck :-( Well if acts_as_taggable behaves as Lasse says then sounds like you need to write a custom validation method that checks the various cases that can occur. Something like validates

[Rails] Re: Active record validation Issue

2010-02-17 Thread Sharagoz --
What are you trying to validate? That the tag_list doesn't contain elements longer than 2 charaters? I reckon you'd have to do the validation manually then private def validate #Do some checks on self.tag_list and if it fails: errors.add(:tag_list, 'cannot contain elements longer than 2

[Rails] Re: ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Grary
Fred, Per your comment... ...if your PATH has /opt/local/bin higher up then the /opt/local install of ruby might not have rubygems at all. Sounds like you need to install rubygems for your new ruby install ...yes, here is my path:

[Rails] Re: ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Frederick Cheung
On Feb 17, 12:21 pm, Grary grary.sti...@gmail.com wrote: So, you're recommending that I install RubyGems anew? Can't I modify the recognition of my new ruby installation for RubyGems? Well you could try transplanting the various bits of rubygems from one ruby install to another but even if

[Rails] Rails/Rake Migrations - Newbie Question

2010-02-17 Thread lukas
Hello, I have a problem understanding Rails/Rake migrations. For example let's say I have a migrate-script like this: class CreateUsers ActiveRecord::Migration def self.up create_table :users do |t| t.string :name t.string :username t.string :password t.string

Re: [Rails] Rails/Rake Migrations - Newbie Question

2010-02-17 Thread Colin Law
On 17 February 2010 13:12, lukas lukas.zielin...@googlemail.com wrote: Hello, I have a problem understanding Rails/Rake migrations. For example let's say I have a migrate-script like this: class CreateUsers ActiveRecord::Migration  def self.up    create_table :users do |t|      t.string

[Rails] Re: ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Grary
Fred, I'm just hoping to get Rails working again, so I'll do whatever's easy... sudo gem install rubygems-update sudo update_rubygems ...I still get the same message. What did you mean when you wrote: Sounds like you need to install rubygems for your new ruby install? Thanks, Grar -- You

[Rails] Re: Rails/Rake Migrations - Newbie Question

2010-02-17 Thread lukas
Colin, Thanks. You know, I first looked at Rails one year ago and knew this. But somehow I forgot it. Thanks for pointing knucklehead-me back to the basics. :) I basically create new migrations and then db:migrate works like a charm. Thanks! On 17 Feb., 14:38, Colin Law clan...@googlemail.com

[Rails] Ensure single session per user

2010-02-17 Thread Nick Gins
Hey Everyone, I would like to add the ability to control that a single user can be logged in only once. In other words, if User A logs in and then another person with User A credentials logs in, it will destroy the session of the first session and log them out. As far as the security of the

[Rails] Re: Back button

2010-02-17 Thread Bob
I think this would do what you're looking for. %= link_to 'Back', request.headers['HTTP_REFERER'] % Hope this helps, On Feb 17, 6:02 am, Frederick Cheung frederick.che...@gmail.com wrote: On Feb 17, 10:35 am, Ralph Shnelvar li...@ruby-forum.com wrote: Anthony Franco wrote: Try:

[Rails] Paperclip and viewing images

2010-02-17 Thread Dave Lynch
I have two objects Task and Asset and I want to view image in show task. Here is my to models Task.rb has_many Assets :as = :attachable And Asset.rb has_attached_file :photo, :styles = { :large = 371*251, :small = 72*72}, :url = /assets/:id/, :path =

[Rails] Re: ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Frederick Cheung
On Feb 17, 1:59 pm, Grary grary.sti...@gmail.com wrote: Fred, I'm just hoping to get Rails working again, so I'll do whatever's easy...  sudo gem install rubygems-update  sudo update_rubygems ...I still get the same message. That's because you're installing rubygems-update using gem

Re: [Rails] Ensure single session per user

2010-02-17 Thread Xavier Noria
On Wed, Feb 17, 2010 at 3:19 PM, Nick Gins li...@ruby-forum.com wrote: I would like to add the ability to control that a single user can be logged in only once.  In other words, if User A logs in and then another person with User A credentials logs in, it will destroy the session of the first

[Rails] Re: ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Grary
Fred, Thanks. I reinstalled the whole thing such that which ruby /opt/local/bin/ruby which gem /opt/local/bin/gem Rails now seems to respond as desired. Doubtless I'll need to better familiarize myself with the interaction of ruby and rubygems for further growth in Rails. best, Grar On Feb

Re: [Rails] combobox-distinct element

2010-02-17 Thread ben wiseley
You can use .uniq! on any array (which includes ActiveRecord.find(:all...) return values). In terms of setting the other combo boxes you'll either need to ajax back to the controller or pass all data in the first time and have javascript do some filtering for you (which you choose depends on how

Re: [Rails] Re: ruby update on OS X 10.5 and I now this: Rails requires RubyGems = 1.3.2

2010-02-17 Thread Hassan Schroeder
On Wed, Feb 17, 2010 at 8:03 AM, Grary grary.sti...@gmail.com wrote: Thanks. I reinstalled the whole thing such that which ruby /opt/local/bin/ruby which gem /opt/local/bin/gem Doubtless I'll need to better familiarize myself with the interaction of ruby and rubygems for further growth

[Rails] url rewriting

2010-02-17 Thread Craig White
I discovered Sanitize gem and it's pretty good but one thing I can see is that if someone puts a URL in the body of text without markup, that would become a link that would drive the person who clicks the link off-site which I don't really want. So if I have say... @test = This is a really cool

[Rails] Re: Memcached

2010-02-17 Thread kwe...@pobox.com
On Feb 16, 5:00 pm, Nicholas Wieland nicholas.wiel...@gmail.com wrote: Hi guys, I remember using memcached in the past, but after the 2.1 release I can't figure out how I'm suppose to configured it with different environments. Cache_fu had a memcached.yml in config/, but I can't find how to

[Rails] Re: Memcached

2010-02-17 Thread kwe...@pobox.com
On Feb 17, 8:46 am, kwe...@pobox.com kurt.we...@gmail.com wrote: On Feb 16, 5:00 pm, Nicholas Wieland nicholas.wiel...@gmail.com wrote: Hi guys, I remember using memcached in the past, but after the 2.1 release I can't figure out how I'm suppose to configured it with different

[Rails] Re: Back button

2010-02-17 Thread Marnen Laibow-Koser
Ralph Shnelvar wrote: Is there a way to implement a button that has exactly the same behavior as the browser's back button? You can do this with JavaScript -- check out history.go() -- but there's generally no point in doing so. The Back button is always available in every browser I'm

[Rails] Re: noobish: create migration to add foreign keys with :thro

2010-02-17 Thread Marnen Laibow-Koser
fearless_fool wrote: I'm dipping my toe into the world of data warehousing and dimensional databases. In: http://rails.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html I was excited to find the following under the many to many section -- it's the pattern I'm looking

[Rails] Re: noobish: create migration to add foreign keys with :thro

2010-02-17 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote: [...] * Could ActiveRecord handle more of the model creation in this case? If so, how? ActiveRecord handles none of the model creation, as far as I can tell. If you're asking about whether you could have script/generate model do more, the answer is no, and you

[Rails] Great Lakes Ruby Bash - Call for Proposals

2010-02-17 Thread Brandon Keepers
We are pleased to announce that we are accepting talk proposals for the Great Lakes Ruby Bash to be held on Michigan State University's campus in East Lansing, Michigan on Saturday, April 17th. http://greatlakesrubybash.com/ We're looking for passionate speakers to give 25 and 40

[Rails] Re: Ensure single session per user

2010-02-17 Thread Nick Gins
Any code examples available? Any links for me to checkout their method? Hopefully it's simple with Restful Auth. My current rationale for allowing the second person to bump the first person is to get them annoyed enough for them to have 2 separate user accounts as well as making sure that

[Rails] Re: need advise with search / browsing

2010-02-17 Thread Jarin Udom
Check out the searchlogic gem, it will make your life way easier on this. Jarin Udom Robot Mode LLC On Feb 16, 12:29 pm, tom tomabr...@gmail.com wrote: hi, have a JOB-model, which belongs_to a variety of other models, eg: Industry, Category etc... i have: ##

[Rails] i18n and routes in runnter script

2010-02-17 Thread kb
Hi! We using rails 2.3.5 at the moment. We want to use namedroute_url and i18n in a runner-script. Don't find the packages which provide me these things. Tried stuff like extend ActionController::PolymorphicRoutes include ActionController::Routing -- You received this message because you

Re: [Rails] Re: Ensure single session per user

2010-02-17 Thread Xavier Noria
On Wed, Feb 17, 2010 at 7:03 PM, Nick Gins li...@ruby-forum.com wrote: Any code examples available?  Any links for me to checkout their method? Hopefully it's simple with Restful Auth. You basically need to create a Session model to manage the existing sessions table with AR. Then, write a

[Rails] Ajax

2010-02-17 Thread Manish Belsare
Sir can u guide me in implementation of Ajax calls in Ruby and Rails? wen i m implementing a new page it gives th following op: try { Element.hide(add_answer_link_for_post_-613772418); Element.update(new_answer_form_for_post_-613772418, form action=\/answers\ method=\post\ onsubmit=\new

[Rails] Re: noobish: create migration to add foreign keys with :thro

2010-02-17 Thread Marnen Laibow-Koser
fearless_fool wrote: I'm dipping my toe into the world of data warehousing and dimensional databases. In: http://rails.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html I was excited to find the following under the many to many section -- it's the pattern I'm looking

[Rails] Re: Ensure single session per user

2010-02-17 Thread Robert Walker
Nick Gins wrote: My current rationale for allowing the second person to bump the first person is to get them annoyed enough for them to have 2 separate user Well, I hope you have a captive audience. The first time a site annoyed me in the manner would be the last time I'd use the site. If I

[Rails] Re: Ensure single session per user

2010-02-17 Thread Nick Gins
Robert Walker wrote: Nick Gins wrote: My current rationale for allowing the second person to bump the first person is to get them annoyed enough for them to have 2 separate user Well, I hope you have a captive audience. The first time a site annoyed me in the manner would be the last

[Rails] Re: Ensure single session per user

2010-02-17 Thread Marnen Laibow-Koser
Nick Gins wrote: Robert Walker wrote: Nick Gins wrote: My current rationale for allowing the second person to bump the first person is to get them annoyed enough for them to have 2 separate user Well, I hope you have a captive audience. The first time a site annoyed me in the manner

[Rails] Re: url rewriting

2010-02-17 Thread Marnen Laibow-Koser
Craig White wrote: I discovered Sanitize gem and it's pretty good but one thing I can see is that if someone puts a URL in the body of text without markup, that would become a link that would drive the person who clicks the link off-site which I don't really want. So if I have say...

[Rails] Re: uninitialized constant User::Authentication

2010-02-17 Thread Ozgun Koyun
abhishek.parolkar wrote: Boys, Almost all the time this problem arises because , scope of the Authentication module falls under different context , Its always better to use fully qualified module names, class User ActiveRecord::Base include ::Authentication include

[Rails] Re: Ensure single session per user

2010-02-17 Thread Nick Gins
Marnen Laibow-Koser wrote: Nick Gins wrote: Robert Walker wrote: Nick Gins wrote: My current rationale for allowing the second person to bump the first person is to get them annoyed enough for them to have 2 separate user Well, I hope you have a captive audience. The first time a site

[Rails] Re: uninitialized constant User::Authentication

2010-02-17 Thread Ozgun Koyun
Ozgun Koyun wrote: It didn't work for me. I had to comment out config.active_record.observers = :user_observer. It may not be the perfect solution, but it saved the day. However, I don't know what tomorrow brings :) On the other hand, you should also check if

[Rails] Re: dates not being typecast properly, becoming nil?

2010-02-17 Thread jemminger
I thought this might have been a Passenger bug, but I just tried with Webrick right now and I get the same problem. Any ideas on what could be different between Rails loading the objects for the web vs. the console? On Feb 16, 10:35 pm, jemminger jemmin...@gmail.com wrote: Are you started

Re: [Rails] Re: dates not being typecast properly, becoming nil?

2010-02-17 Thread ben wiseley
I don't know if this is related but I spent half my morning trying to figure out why I was getting nil.include? errors for date fields only after reloading the page (Ruby 1.8.7, Rails 2.3.5). This was the fix (in env.rb): #config.time_zone = 'UTC' config.active_record.default_timezone =

[Rails] Re: FCGI resetting view cache

2010-02-17 Thread Brent
Anyone have any idea? I just tried to alter a controller too and It's not taking any of the changes. =/ -- 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

Re: [Rails] Re: Ensure single session per user

2010-02-17 Thread Xavier Noria
Nick do you have any experience with Rails? Is there some point in my explanation that it is not clear? -- 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

[Rails] Re: FCGI resetting view cache

2010-02-17 Thread Ozgun Koyun
Brent wrote: I'm running my rails app with FCGI. I updated a view and noticed it didn't update the site. Deleted it and it even still shows up. I also tried pkill -9 -f dispatch.fcgi. I thought I had done this in the past with controllers and views and it updated.. How do I reset it to load

[Rails] Re: FCGI resetting view cache

2010-02-17 Thread Marnen Laibow-Koser
Brent wrote: I'm running my rails app with FCGI. Why on earth are you doing that? I updated a view and noticed it didn't update the site. Deleted it and it even still shows up. I also tried pkill -9 -f dispatch.fcgi. I thought I had done this in the past with controllers and views and

[Rails] Re: login with twitter, yahoo, google, facebook credentials......

2010-02-17 Thread Ozgun Koyun
Chris Habgood wrote: Does anyone know how to go about giving an option to login to a website with twitter, yahoo, google, facebook , . whatever credentials? openid, facebooker -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

[Rails] Re: uninitialized constant User::Authentication

2010-02-17 Thread Marnen Laibow-Koser
Dave Amos wrote: Hi there, I just ran the generator for Restful Authentication, and when I visit localhost:3000/users/new, I get the error: uninitialized constant User::Authentication Since you just put restful_auth into your project, do yourself a favor and take it right back out again.

[Rails] Re: Newbie RESTful routing problem, please help!

2010-02-17 Thread Ozgun Koyun
tuti plain wrote: C:/jruby/lib/ruby/gems/1.8/gems/glassfish-1.0.2-universal-java/lib/rack/adapter/rails.rb:133:in `call' C:/jruby/lib/ruby/gems/1.8/gems/glassfish-1.0.2-universal-java/lib/rack/handler/grizzly.rb:55:in `call' I then tried setting up my routing like this: map.resources

[Rails] rspec + rcov + rails + sequel (false coverage report)

2010-02-17 Thread GregD
Anyone use rcov (0.9.4) on a rails (2.3.5) app that is using Sequel (3.8.0)? The coverage report is including blank and comment lines as not being executed. It is also including the class definition line as being not executed when the instance and class methods have been executed. I'm not sure

[Rails] Converting hash to option string

2010-02-17 Thread Ralph Shnelvar
Is there a good way to programmatically convert {:a='b', :c='d'} to 'a=b c=d' ? Rails seems to do this knid of thing all over the place. I see reverse_merge and similar functions ... but I wonder if this is canned behavior somewhere. -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: combobox-distinct element

2010-02-17 Thread Veena Jose
Ben Wiseley wrote: You can use .uniq! on any array (which includes ActiveRecord.find(:all...) return values). In terms of setting the other combo boxes you'll either need to ajax back to the controller or pass all data in the first time and have javascript do some filtering for you

[Rails] Rails 3 version of ActiveRecord usable with Rails 2?

2010-02-17 Thread Jeff
Anybody know if the changes coming to Rails 3 that affect ActiveRecord can be applied to Rails 2.x projects as well? If it's just the ActiveRecord gem that's changing, then we should be able to use the new ActiveRecord gem with Rails 2 apps, right? (I ask because I've had trouble trying it out

[Rails] Re: Converting hash to option string

2010-02-17 Thread Jeff
On Feb 17, 9:50 pm, Ralph Shnelvar li...@ruby-forum.com wrote: Is there a good way to programmatically convert   {:a='b', :c='d'} to   'a=b c=d' ? Rails seems to do this knid of thing all over the place. I think you're looking for Hash#to_query: h = { :a = 'b', :c = 'd' } opts =

[Rails] Re: dates not being typecast properly, becoming nil?

2010-02-17 Thread jemminger
Yeah, I have both of those lines in my environment.rb too. Commenting out the first doesn't seem to help my issue though, but thanks for the attempt. I'm going to try reverting to Ruby 1.8.6 next. On Feb 17, 6:09 pm, ben wiseley wisel...@gmail.com wrote: I don't know if this is related but I

[Rails] Array in post data via http

2010-02-17 Thread Prashant
How can I pass my array in post request using ruby ? My array contains 1000 integer values which needs to be passed to a controller function. Need help to do this using http post request. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To