[Rails] telling app to use middleware in gem

2012-01-11 Thread vlad
I have a gem, and part of the gem is a piece of rack middleware. In Rails 2.3, I could make the gem set up the middleware without adding anything to config/*.rb in the app. I did this with the following line: ActionController::Dispatcher.middleware.use 'MyMiddleware' But in Rails 3, this doesn't

[Rails] Re: displaying rails form validation errors inline

2012-01-11 Thread venkata reddy
say for instance, i have a validation on validates first_name, :presence => true -- First Name: can't be blank | | can't be blank -

[Rails] link_to_remote helper messed up?

2012-01-11 Thread Hemant Bhargava
Hi, I have used "link_to_remote" helper quite many times as like:- <%= link_to_remote "Q1", :url => { :controller => "", :action => "", :year => 2012 }, :update => 'div_name' %> which is having source as:- « Today also i used the same syntax and semantic, but surprised to see that same help

Re: [Rails] installing Ruby On Rails on Centos

2012-01-11 Thread Ahmy Yulrizka
try to install those packages yum install gcc gcc-c++ and install ruby then rails. or install usign rvm http://beginrescueend.com/ Ahmy Yulrizka On Thu, Jan 12, 2012 at 12:50 PM, sachin kewale wrote: > hi all, >i am trying to install Ruby on rails on Centos,but giving following > error f

[Rails] installing Ruby On Rails on Centos

2012-01-11 Thread sachin kewale
hi all, i am trying to install Ruby on rails on Centos,but giving following error for gcc complier "gcc compiler is missing" is there any other alternative to install Ruby on rails on Centos or steps to install ruby on rails on Centos ? -- Thanks Sachin S. Kewale -- You received this m

[Rails] Select box with Onchange

2012-01-11 Thread NagaJeyanthi N.
Hi All, I am new to ruby on rails and i am able to select the value from select box but after reloading the page the select box selected value is not selected, please help me... Thanks in Advance. This is the code what i am using <%= select("rnotes", "project_vno", Version.find(:all, :conditio

[Rails] alert with 3 button

2012-01-11 Thread Joachim Cheng
When you click [x] the close button, will show the alert with 3 button like below picture: Show dialog message = Do you want to save changes? All details will be lost if you don't save them. Dont' save | cancel | save

[Rails] Ruby-based attributes, and input splitting

2012-01-11 Thread Dylan Robinson
I'm sorry if these are very simple questions, I just haven't been able to find useful answers for my problems. I've been programming in Ruby for a couple years, and recently started with Rails (having felt most of Ruby seems to be in that direction, these days), so I have a reasonable amount of kn

Re: [Rails] Ruby programming problem

2012-01-11 Thread Dave Aronson
On Wed, Jan 11, 2012 at 06:07, Ahmy Yulrizka wrote: > simple solution is > > change it to : > > var_i * (numb_i || 0) Even simpler solution is to initialize the variable first. But with that approach, you should do them all -- the current solution will barf on the first digit past the one that

Re: [Rails] How to render subactions html into action to sent string to view later

2012-01-11 Thread Dave Aronson
On Tue, Jan 10, 2012 at 04:36, Heike wrote: > I've got a bunch of campaigns I wish to render into an index-page. > Two diagrams have to be in each campaign (jQuery). One of them > requires a database query within a loop (the finished orders for each > day of one week). > > Since its bad code to p

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
On Jan 11, 2:52 pm, Colin Law wrote: > So the question is, what is the difference between > bundle pack > and > bundle install --path vendor/cache > > Colin I found the pack command in "Agile Web Development with Rails", fourth edition on page 235. I stumbled across the install command while

Re: [Rails] Can't create new rails project behind proxy

2012-01-11 Thread Peter Vandenabeele
On Wed, Jan 11, 2012 at 4:27 PM, Josh J. wrote: > When I run: > rails new > > I get the following error: > Fetching source index for http://rubygems.org/ > Could not reach rubygems repository http://rubygems.org/ > Could not find gem 'turn (>= 0) x86-mingw32' in any of the gem sources > listed i

[Rails] Re: spork/guard/rspec now disregarding filter tags for examples

2012-01-11 Thread Stan Kaufman
On Jan 11, 10:21 am, Stan Kaufman wrote: > Something in the latest iteration of spork, guard, or rspec now causes > all examples to be run, not just tagged examples (say, with :focus => > true). Hmm...looks like this is a spork vs rspec problem; the behavior occurs without involving guard: - rsp

Re: [Rails] Re: [OT] CodeRunner and RVM

2012-01-11 Thread Walter Lee Davis
Yes, and yes, I already tried that first. I get the correct ruby in any script I run in there, but I don't see the nokogiri gem, even though it's listed correctly in gem list. Walter On Jan 11, 2012, at 1:58 PM, Michal Papis wrote: > are you sure you run stable rvm ? > >rvm get stable >

[Rails] Can't create new rails project behind proxy

2012-01-11 Thread Josh J.
When I run: rails new I get the following error: Fetching source index for http://rubygems.org/ Could not reach rubygems repository http://rubygems.org/ Could not find gem 'turn (>= 0) x86-mingw32' in any of the gem sources listed in your Gemfile. I think the problem is that I'm behind a proxy.

[Rails] Re: [OT] CodeRunner and RVM

2012-01-11 Thread Michal Papis
are you sure you run stable rvm ? rvm get stable also you can use one of rubies listed by: ls -1 $rvm_path/wrappers/*/ruby just put the full path instead of ruby in the 'Run Command': ruby $filename On Jan 11, 6:24 pm, Walter Lee Davis wrote: > On Jan 10, 2012, at 10:54 PM, ruij

[Rails] Re: ActiveRecord: ar-each_model

2012-01-11 Thread Robert Walker
tvw wrote in post #1040336: > today I went into a problem, when I had to iterate over a big result > set. ActiveRecord produces a huge array of model instances, which > consumed 1GB of memory on my machine. A comparable perl DBI script > only used some KB for iterating over the result set. It is w

[Rails] Re: Observe field with jquery in Rails 3.1

2012-01-11 Thread Robert Walker
Robert Walker wrote in post #1040404: > $(function() { > $('#fieldset').click(function() { alert("Clicked"); }); > }); > > If this works then you know you're finding the right HTML element and > correctly binding a "click." Once you've confirmed this then try the > more complex bind syntax. If y

Re: [Rails] Re: passenger does not see gems in vendor/cache

2012-01-11 Thread Colin Law
On 11 January 2012 18:06, jsnark wrote: > > > On Jan 11, 11:55 am, Colin Law wrote: > >> Because that is what bundle install is for, to install the appropriate >> gems as defined by Gemfile and gemfile.lock. >> The one thing I am not sure of is why it did not work when the gems >> were already in

[Rails] Re: Observe field with jquery in Rails 3.1

2012-01-11 Thread Robert Walker
Hans Marmolin wrote in post #1040373: > $(document).ready(function() { > $('#fieldset').bind({ > click: function() { > alert('Change'); > // do something on click > }, > mouseenter: function() { > // do something on mouseenter > }; > }); > }); > But nothing happens when I click i

[Rails] spork/guard/rspec now disregarding filter tags for examples

2012-01-11 Thread Stan Kaufman
Something in the latest iteration of spork, guard, or rspec now causes all examples to be run, not just tagged examples (say, with :focus => true). This was posted as an issue for rspec: https://github.com/dchelimsky/rspec/issues/47 But when running the same command that guard generates in verbos

Re: [Rails] Observe field with jquery in Rails 3.1

2012-01-11 Thread Bill Walton
Hi Hans, On Wed, Jan 11, 2012 at 10:35 AM, Hans wrote: > I tries to observe a change  in a field  with jquery in Rails 3.1 in > order to be able to implement  two cascading select boxes. > A a first step I just try to observe a click in a div using jquery > I have the following function in a .js

[Rails] Re: Windows, Rails 3.1.3, Omniauth-BrowserID, SSL Erro

2012-01-11 Thread Luis Lavena
On Jan 9, 7:14 pm, RobboRex wrote: > > SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: > certificate verify failed > > I've had it before and fixed it by downloading certificates and > setting the path but that was using omniauth-facebook and on linux. > Please don't tell me

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
On Jan 11, 11:55 am, Colin Law wrote: > Because that is what bundle install is for, to install the appropriate > gems as defined by Gemfile and gemfile.lock. > The one thing I am not sure of is why it did not work when the gems > were already in vendor/cache.  How did you get them there in the

[Rails] Re: Ruby programming problem

2012-01-11 Thread Loren
Thank you. I will take a look at it. On Jan 11, 3:04 pm, Colin Law wrote: > On 11 January 2012 11:07, Ahmy Yulrizka wrote: > > > > > > > > > > > > > Ahmy Yulrizka > > > On Wed, Jan 11, 2012 at 1:43 AM, Loren wrote: > > >> ... > >>    puts var_m * numb_m + var_d * numb_d + var_c * numb_c + var_l

Re: [Rails] Re: [OT] CodeRunner and RVM

2012-01-11 Thread Walter Lee Davis
On Jan 10, 2012, at 10:54 PM, ruijie chen wrote: > hello, you can change the Languages preferences 'Run Command' from: > ruby $filename > to: > [[ -s /Users/__yourname__/.rvm/scripts/rvm ]] && source > /Users/__yourname__/.rvm/scripts/rvm && ruby $filename > > pls change __yourname__ to your h

[Rails] Re: Newbie question: How to save multiple records in a single form

2012-01-11 Thread Angelo Cordova
On 9 ene, 21:05, Mohamad El-Husseini wrote: > Started learning Ruby and RoR a couple of days ago and I'm working on a > dummy app. > > I want to allow a user to save 5 records at the same time using a single > form. Let's assume "contact" records, with each one consisting of a single > "name" fi

[Rails] Re: to enter date and time in rails application

2012-01-11 Thread Angelo Cordova
On 11 ene, 10:24, Kapil Kaligotla wrote: > I am new learner in rails, i am using rails 3.0.10 . I want to use the > date and and time in my project, please tell me the better way to use > it Maybe, you should take a look at this http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.

Re: [Rails] passenger does not see gems in vendor/cache

2012-01-11 Thread Colin Law
On 11 January 2012 16:09, jsnark wrote: > I am using capistrano v2.9.0 to deploy to a ubuntu server running > apache v2.2.12, passenger v3.0.4, ruby v1.9.2 and rails v3.0.1.  When > I deploy a new application, I often get error messages like: > > Could not find net-ssh-2.2.2 in any of the sources

[Rails] Re: passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
Correction. I'm actually running rails v3.0.7. -- 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 this group, send email to rubyonrails-talk+unsubs

[Rails] Observe field with jquery in Rails 3.1

2012-01-11 Thread Hans
I tries to observe a change in a field with jquery in Rails 3.1 in order to be able to implement two cascading select boxes. A a first step I just try to observe a click in a div using jquery I have the following function in a .js file that is loadedin the head section (fieldset is the id of a d

[Rails] passenger does not see gems in vendor/cache

2012-01-11 Thread jsnark
I am using capistrano v2.9.0 to deploy to a ubuntu server running apache v2.2.12, passenger v3.0.4, ruby v1.9.2 and rails v3.0.1. When I deploy a new application, I often get error messages like: Could not find net-ssh-2.2.2 in any of the sources (Bundler::GemNotFound) The missing gem is actuall

Re: [Rails] to enter date and time in rails application

2012-01-11 Thread Colin Law
On 11 January 2012 13:24, Kapil Kaligotla wrote: > I am new learner in rails, i am using rails 3.0.10 . I want to use the > date and and time in my project, please tell me the better way to use > it Time.now will return the current date and time if that is what you mean. Have a look at the docs f

Re: [Rails] Pulling data from a one-to-many association

2012-01-11 Thread Colin Law
On 10 January 2012 22:23, Mohamad El-Husseini wrote: > Another newbie question. My dummy app has the following models: > > class User < ActiveRecord::Base >   has_one :list > end > > class List < ActiveRecord::Base >   belongs_to :user >   has_many :celebs > end > > class Celeb < ActiveRecord::Bas

Re: [Rails] Ruby programming problem

2012-01-11 Thread Colin Law
On 11 January 2012 11:07, Ahmy Yulrizka wrote: > > Ahmy Yulrizka > > > On Wed, Jan 11, 2012 at 1:43 AM, Loren wrote: >> >> ... >>    puts var_m * numb_m + var_d * numb_d + var_c * numb_c + var_l * >> numb_l + var_x * numb_x + var_v * numb_v + var_i * numb_i > > > this line interpret as var_i * ni

[Rails] Re: displaying rails form validation errors inline

2012-01-11 Thread Tim Shaffer
What does your view look like? Do you have any error message related code in there? What does the output HTML look like? Is the error message repeated in the HTML? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion

[Rails] error message in rails

2012-01-11 Thread Kapil Kaligotla
Hi, I used the below syntax in config/initializers, but i am getting the error message two times, please suggest me the better way to over come it ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| if html_tag =~ /<(input|label|textarea|select)/ error_class = 'error'

[Rails] to enter date and time in rails application

2012-01-11 Thread Kapil Kaligotla
I am new learner in rails, i am using rails 3.0.10 . I want to use the date and and time in my project, please tell me the better way to use it -- 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 rubyonrai

Re: [Rails] Pulling data from a one-to-many association

2012-01-11 Thread thiagocifani
You can try This way @user.includes(celebs) Sent from my iPad On 11/01/2012, at 08:50, Peter Vandenabeele wrote: > On Tue, Jan 10, 2012 at 11:23 PM, Mohamad El-Husseini > wrote: > Another newbie question. My dummy app has the following models: > > class User < ActiveRecord::Base > has_one

Re: [Rails] Ruby programming problem

2012-01-11 Thread Ahmy Yulrizka
Ahmy Yulrizka On Wed, Jan 11, 2012 at 1:43 AM, Loren wrote: > def romnum leftover >var_i = 'I' >var_v = 'V' >var_x = 'X' >var_l = 'L' >var_c = 'C' >var_d = 'D' >var_m = 'M' > >leftover = '' > >leftover = gets.chomp > >numb_m = leftover.to_i / 1000 >l

Re: [Rails] Pulling data from a one-to-many association

2012-01-11 Thread Peter Vandenabeele
On Tue, Jan 10, 2012 at 11:23 PM, Mohamad El-Husseini < husseini@gmail.com> wrote: > Another newbie question. My dummy app has the following models: > > class User < ActiveRecord::Base > has_one :list > Try to add here: has_one :list_with_celebs, :class_name => "List", :include => :c

Re: [Rails] Newbie question: How to save multiple records in a single form

2012-01-11 Thread Ahmy Yulrizka
Here are good example http://railscasts.com/episodes/73-complex-forms-part-1 Ahmy Yulrizka On Tue, Jan 10, 2012 at 7:05 AM, Mohamad El-Husseini wrote: > Started learning Ruby and RoR a couple of days ago and I'm working on a > dummy app. > > I want to allow a user to save 5 records at the same

Re: [Rails] Opening rails with

2012-01-11 Thread vitor santos
Redcar open the redcar editor u just choise open diretory and choise u projetc to tree :) 2012/1/9 Mathew S. > How do you open Rails up with Aptana and or Redcar through the "Command > Prompt with Ruby and Rails"? > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message

[Rails] Windows, Rails 3.1.3, Omniauth-BrowserID, SSL Erro

2012-01-11 Thread RobboRex
One and all, I have scoured the internet high and low tonight and I can not for the life of me fix this damn problem. I have downloaded certificates, installed certificates, changed my :ca_path and such as stated in the documentation for omniauth-facebook for which I thought would be ok to do with

[Rails] Newbie question: How to save multiple records in a single form

2012-01-11 Thread Mohamad El-Husseini
Started learning Ruby and RoR a couple of days ago and I'm working on a dummy app. I want to allow a user to save 5 records at the same time using a single form. Let's assume "contact" records, with each one consisting of a single "name" field. It's a "user has_many contacts" relationship. Any

[Rails] How to render subactions html into action to sent string to view later

2012-01-11 Thread Heike
Hi, I've got a bunch of campaigns I wish to render into an index-page. Two diagrams have to be in each campaign (jQuery). One of them requires a database query within a loop (the finished orders for each day of one week). Since its bad code to put a database query in the view, and I dont want to

[Rails] Pulling data from a one-to-many association

2012-01-11 Thread Mohamad El-Husseini
Another newbie question. My dummy app has the following models: class User < ActiveRecord::Base has_one :list end class List < ActiveRecord::Base belongs_to :user has_many :celebs end class Celeb < ActiveRecord::Base belongs_to :list end I want to load a user's list, and include the cel

[Rails] Ruby programming problem

2012-01-11 Thread Loren
I just started to teach myself ruby as a first language from Chris Pines's book. There is a exercise to write a program that will translate arabic numbers to old style roman numbers. I have completed the exercise and my code is works but only if I type in numbers that are not divisible by 5. As soo

[Rails] ActiveRecord: ar-each_model

2012-01-11 Thread tvw
Hi, today I went into a problem, when I had to iterate over a big result set. ActiveRecord produces a huge array of model instances, which consumed 1GB of memory on my machine. A comparable perl DBI script only used some KB for iterating over the result set. Then I was suggested to use batch (#fi

[Rails] Installing 4.0.0.beta

2012-01-11 Thread HMCFletch
I had a patch that I was working on prior to the 3.2 RC drops. I updated my fork which is now on 4.0.0.beta and can't get bundle install to complete. It dies on the jquery-rails gem install because of the railties ~> 3.0 dependency. Any help on getting 4.0.0.beta up and running would be much apprec