[Rails] Re: q: observer

2015-11-20 Thread Juan Pablo Avello
- If you need to do different things to each class you probably want different observers for each one. Anyway, if they all share the attributes needed inside the observer you don't really need those "if". - A better looking alternative to 'record.class.name=="Order"' could be: 'record.is_a?(Orde

Re: [Rails] best practices in methods

2012-11-13 Thread Juan Pablo
deseos, Best wishes, Meilleurs vœux, Juan Pablo -- http://www.jpgenovese.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-ta

Re: [Rails] How to use Ajax with rails ?

2012-10-26 Thread Juan Pablo
subscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/t_GmEPrLUIMJ. For more options, visit https://groups.google.com/groups/opt_out. -- -- Mis mejores deseos, Best wishes, M

[Rails] Re: undefined method `paginate'

2012-05-23 Thread Juan Pablo Avello
El miércoles, 23 de mayo de 2012 08:31:51 UTC+2, Ruby-Forum.com User escribió: > > > You dont have a "def paginate " method defined in your controller. > > Anyway you'll probably want to use a pagination gem such as Kaminari, > > which > > includes all you need for that purpose. > > Hi Juan,

Re: [Rails] loop in rails view

2012-05-22 Thread Juan Pablo Avello
I would still iterate the elements that way, then you may extract the div construction to several partials or a helper receiving the key and value that deals with what to render on each case. It may sound a bit complex, but this way you keep your views clean, which are 90% of the times the dir

Re: [Rails] loop in rails view

2012-05-22 Thread Juan Pablo Avello
El martes, 22 de mayo de 2012 15:56:54 UTC+2, amvis escribió: > > > > On Tuesday, 22 May 2012 09:34:20 UTC-4, azizmb.in wrote: >> >> Also, you could clean things a little by doing: >> >> <% @update_coupon.select{|doc| doc["value"] == 2}.each do |doc| %> >> do stuff >> <% end %> >> >> > T

[Rails] Re: undefined method `paginate'

2012-05-22 Thread Juan Pablo Avello
El martes, 22 de mayo de 2012 15:37:04 UTC+2, Ruby-Forum.com User escribió: > > I am working with Railsspace social networking book. I stuck in the > problem when i am doing paginate for the search result. It gives the > following error. > > NoMethodError in CommunityController#index > > unde

[Rails] Re: loop in rails view

2012-05-22 Thread Juan Pablo Avello
El martes, 22 de mayo de 2012 15:29:04 UTC+2, amvis escribió: > > *controller* > @update_coupon = JSON.parse(get_updatecpn.body) > * > * > *view* > 1, <% @update_coupon.each do |doc| %> > 2, <% if doc["value"] == 2 %> > > 3, <%end%> > > Here the *@update_coupon* getting from controller,In the co

Re: [Rails] Re: Searching for area code and phone number together

2012-04-24 Thread Juan Pablo Avello
On 24 April 2012 20:32, Rafael C. de Almeida wrote: > On Apr 24, 3:24 pm, Rogerio Medeiros wrote: > > phones = [{area_code:'31', number:'32210412'}, > > {area_code:'32', number:'32210412'}] > > > > lawyers = [] > > phones.each do |phone| > > lawyer << Lawyer.joins(:phones).where('phones.area_

[Rails] Re: Searching for area code and phone number together

2012-04-24 Thread Juan Pablo Avello
El martes, 24 de abril de 2012 03:56:21 UTC+2, Rafael C. de Almeida escribió: > > Hello > > I have two tables: Lawyer and Phone. Phone is separated into area code > and number. A lawyer has many phones. I want to produce a query which > searches for lawyers who have a phone matching a phone f

[Rails] Re: Rails Query Pulling Inaccurate Results

2012-04-16 Thread Juan Pablo Avello
El lunes, 16 de abril de 2012 23:43:44 UTC+2, yellowreign escribió: > > m running Rails 3.0.7, Ruby 1.9.2, and mySQL (local and remote). I have a > query which is pulling in records that I don't understand. The purpose of > the query is to total points that users receive from customer jobs they

[Rails] Re: Error installing therubyracer

2012-04-15 Thread Juan Pablo Avello
El domingo, 15 de abril de 2012 13:42:53 UTC+2, Ruby-Forum.com User escribió: > > I am using Fedora 16 fresh install, latest upgrades, I have gcc, gems, > libv8, make, bundler etc installed. > This error has me tossed.I've googled for hours and not found a > resolution. > > firefox localhost:30

[Rails] Re: Problem to deploy with Capistrano

2012-04-14 Thread Juan Pablo Avello
El sábado, 14 de abril de 2012 18:53:52 UTC+2, LuisRuby escribió: > > Hi, friends! > > I'm using Rails 3.2.3, RVM, Postgresql 9.1.3 and running Ubuntu Server > 11.10 on my own Dell server. > I tried this: > > cap deploy:check > * executing `deploy:check' > * executing "test -d /home/digifot

[Rails] Re: Damn associations

2012-04-14 Thread Juan Pablo Avello
El sábado, 14 de abril de 2012 13:58:56 UTC+2, Ruby-Forum.com User escribió: > > I'm a newbie and have searched many posts and railscast tutorials and > still cant get around this associations thing. > > I have 2 models, a Hotel (created by scaffolding) and Facility. > > The point is to associate

[Rails] Re: empty field check.

2012-04-14 Thread Juan Pablo Avello
El sábado, 14 de abril de 2012 14:05:08 UTC+2, Ruby-Forum.com User escribió: > > Juan Pablo Avello wrote in post #1056480: > > El sbado, 14 de abril de 2012 13:12:19 UTC+2, Ruby-Forum.com User > > escribi: > >> class CourseLesson < ActiveRecord::Base > >&g

[Rails] Re: empty field check.

2012-04-14 Thread Juan Pablo Avello
El sábado, 14 de abril de 2012 13:12:19 UTC+2, Ruby-Forum.com User escribió: > > Thank you Juan and Colin. > One thing I didn't mention is that canceled_time comes from different > class where the relationship is: > > class CourseDate < ActiveRecord::Base > has_many :course_lessons > end > > Co

[Rails] Re: empty field check.

2012-04-14 Thread Juan Pablo Avello
El sábado, 14 de abril de 2012 01:01:04 UTC+2, Ruby-Forum.com User escribió: > > Hi, > I'm trying to select record as follows: > @course = CourseDate.find_all_by_date_and_canceled_time(Date.today,nil) > > records with todays date but those where the canceled_time is empty, the > above find selects

[Rails] Re: new rails project error

2012-04-04 Thread Juan Pablo Avello
es 4 de abril de 2012 16:26:40 UTC+2, Ruby-Forum.com User escribió: > > Juan Pablo Avello wrote in post #1055004: > > El mircoles 4 de abril de 2012 15:30:15 UTC+2, Ruby-Forum.com User > > escribi: > >> Gem::Installer::ExtensionBuildError: ERROR: Failed to build ge

[Rails] Re: new rails project error

2012-04-04 Thread Juan Pablo Avello
El miércoles 4 de abril de 2012 15:30:15 UTC+2, Ruby-Forum.com User escribió: > > Hi all, > > > I install Ruby1.9.2po0 and Rails3.2.3 on RedHat5 > When I create a project "rails nwe chapter" > > It show below error message: > * > Insta

[Rails] Re: [Arel]Building query, but can't get a proper output

2012-03-13 Thread Juan Pablo Avello
El martes 13 de marzo de 2012 15:10:40 UTC+1, Ruby-Forum.com User escribió: > > I have the following code: > > advertisements_arel = Advertisement.order("advertisements.id > DESC").arel > @advertisements = (params[:website_id].present? ? > advertisements_arel.where(:website_id => params

[Rails] Re: Encoding Issues Seeds.rb

2012-03-12 Thread Juan Pablo Avello
El lunes 12 de marzo de 2012 11:38:24 UTC+1, Maxus escribió: > > Hi All, > > I rebuilt my enviroment on linux, still the same issue occours. Any one > have any idea whats going on? > > Thanks! > Maxus > > > > On Monday, March 5, 2012 4:21:44 PM UTC+8, Maxus wrote: > >> Hi People, >> >>

[Rails] Re: At least one entry for DB

2012-03-07 Thread Juan Pablo Avello
El miércoles 7 de marzo de 2012 10:01:30 UTC+1, Ruby-Forum.com User escribió: > > Rails 3.1.3 > > I have models and their association like, > > Video 1: n: Script > > When users newly create a Video, I want it to create the very first > Script entry together. > > I have put > > @scr

[Rails] Re: rails3 data inserting issues

2012-03-02 Thread Juan Pablo Avello
El viernes 2 de marzo de 2012 10:35:20 UTC+1, amvis escribió: > > I am using rails3. when i am trying to insert data into postgrsql got the > error like this > > > *PGError: ERROR: value too long for type character varying(15)* > > In the migration file have * t.string > :contact_number,:limit=

[Rails] Komodo Edit + rvm

2010-09-02 Thread Juan Pablo
t and didn't find any solution that worked... Anyone that made them work together? Thanks a lot! Juan Pablo -- 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

Re: [Rails] Anyboby know to integrate youtube videos in rails app

2010-08-27 Thread Juan Pablo Genovese
> To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- Mis mejores deseos, Best wishes, Meilleurs vœux, Juan Pablo --

Re: [Rails] draw ER Diagrams for models

2010-07-28 Thread Juan Pablo Genovese
Jetbrains RubyMine IDE can do that. Sateesh Kambhamapati wrote: Hi I would like to know the relations ship between models by using er diagrams. How it is ?? please suggest me -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post

Re: [Rails] Re: Re: Re: Sqlite3 busy and yet server has no load nor concurrency

2010-07-27 Thread Juan Pablo Genovese
Lite database for a Gnome2-ruby application I'll be developing soon, but only for config data and stuff like that. But, in case of Web Applications, I would rather go with something much more elaborated than SQLite. Cheers! Juan Pablo Fernando Perez wrote: Juan Pablo Genovese wrote: Bu

Re: [Rails] How to write codes for TDD

2010-07-27 Thread Juan Pablo Genovese
Buy "The RSpec Book" from Pragmatic. It's outstanding, and will give you extremely useful insight on TDD and BDD. Cheers!! debadatta wrote: Hi all, I am a newbie in rails. I have done some small applications in rails but can't know how to make TDD and BDD in RSpec and other tools. I have

Re: [Rails] Re: Re: Sqlite3 busy and yet server has no load nor concurrency

2010-07-23 Thread Juan Pablo Genovese
Well, giving a second thought, it all depends. :) If your app has very low concurrency and traffic, and if it is low in transaction intensity and you don't have any security constraints, SQLite may be *it is* fit for production. But... with SQLite you have poor support for concurrency, it's no

Re: [Rails] Re: Sqlite3 busy and yet server has no load nor concurrency

2010-07-23 Thread Juan Pablo Genovese
Fernando, glad you solved the issue!! However, I must say this: *don't* use SQLite in production environments! It's excellent for development, but flimsy and poor suited for production. Try MySQL or PostgreSQL for cost-free production ready databases. Cheers!! Fernando Perez wrote: If anyone

Re: [Rails] Configuring GIT repository on dreamhost - novice

2010-07-22 Thread Juan Pablo Genovese
u ask here: http://groups.google.com/group/git-users Cheers and happy coding! Juan Pablo Sachin wrote: Hello Experts, I am trying to host a git repository in dreamhost, have a pre installed git version 1.5.4.1 on the server. I have referred to many sites on which a lot of information given.

Re: [Rails] Re: About "Rails Recipes", Fowler, 2006

2010-07-06 Thread Juan Pablo Genovese
d work in the future. -- Mis mejores deseos, Best wishes, Meilleurs voeux, Juan Pablo -- http://www.twitter.com/eljuanchosf RichardOnRails wrote: Hey Marnen, Suppose someone posted on the Math Forum (if there is such a thing) the question: what

Re: [Rails] Re: About "Rails Recipes", Fowler, 2006

2010-07-05 Thread Juan Pablo Genovese
s, Best wishes, Meilleurs vœux, Juan Pablo -- http://www.twitter.com/eljuanchosf 2010/7/5 Marnen Laibow-Koser > RichardOnRails wrote: > > Hi Marnen, > > > > Thanks for your response (especially since you posted with an &g

Re: [Rails] Error: Trying to install passenger-install-apache2-module

2010-06-24 Thread Juan Pablo Genovese
.com > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- Mis mejores deseos, Best wishes, Meilleurs vœux, Juan Pablo -- http://www.twitter.com/eljuanchosf -- You receive

Re: [Rails] Learning RoR

2010-06-16 Thread Juan Pablo Genovese
ils-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- Mis mejores deseos, Best wishes, Meilleurs

Re: [Rails] Re: problem with the getting started tutorial

2010-05-28 Thread Juan Pablo Genovese
ssary users and permissions by yourself. Check this page for reference: http://wiki.rubyonrails.org/getting-started/installation/linux Hope this helps. :) 2010/5/28 Roelof Wobben > Juan Pablo Genovese wrote: > > Is your MySQL instance running in the same computer? If no, did you op

Re: [Rails] sqlite3 module not found

2010-05-14 Thread Juan Pablo Genovese
Andi, Download this file and extract it's contents to your Ruby's bin directory. http://www.sqlite.org/sqlitedll-3_6_23_1.zip Cheers! JP 2010/5/14 Andi Lebaron > Hi, I'm trying to follow the Rails tutorial found here, > http://guides.rubyonrails.org/getting_started.html and when I go to run >

Re: [Rails] browser did not show the output

2009-11-26 Thread Juan Pablo Genovese
What URL are you using in your Firefox? dwhitekiss wrote: > Hi, > > I was able to create the a boilerplate code using the generate script. > However, the expected (for this) about page did not show up in the > browser. Do some encountered this already? > > # script/generate controller about inde

Re: [Rails] Re: Best option for a small team of developers (VCS, IDE)?

2009-11-23 Thread Juan Pablo Genovese
Por nada! Buena elección. :) You're welcome. Good choice. :) 2009/11/23 Mike > Thank you everybody! I started using GIT and NetBeans. > > > On 23 nov, 16:11, Leonardo Mateo wrote: > > On Mon, Nov 23, 2009 at 5:12 PM, Mike wrote: > > > Hello, > > > > > I am going to start a new project in R

Re: [Rails] Best option for a small team of developers (VCS, IDE)?

2009-11-23 Thread Juan Pablo Genovese
Hi Mike, we have a very similar team setup. If you want to go completly free, try Netbeans with the Rails Plugin. For us, is the best free IDE out there for Ruby and Ruby On Rails. We switched to RubyMine (paid) but it is really awesome... couldn't be happier. For VCS, we use Git without any doub

[Rails] Re: Ruby and MySQL

2009-10-26 Thread Juan Pablo Genovese
TheTribster wrote: > After 3 days I am giving up on RoR. Don't! Try again. Your efforts we'll be compensated several times with Rails. > I have a MAC and after installing > Aptana RoR no longer see mySQL and after dozens of adjustments and > downloads it still doesn't work. Well... I used Net