[Rails] has_many setter should set conditions if specified

2011-04-25 Thread Mike Anderson
I'm not sure how to think about this experience with has_many association Suppose we have: class User < ActiveRecord::Base has_many :awesome_friends, :class_name => "Friend", :conditions => {:awesome => true} end (as well as the belongs_to in Friend class) And execute the code: >> my_user.aw

[Rails] Looking for Lead Developer (RoR)

2011-04-25 Thread Travtar
Lead Developer Type: Permanent Benefits: Flexible hours, casual/laid-back environment, other perks t.b.d. U.S. based online travel startup looking for a lead developer for the development team; preferably with strong experience with Ruby on Rails. However, can be flexible in this regard; more co

[Rails] Mail program error

2011-04-25 Thread bhanu bhanu
Iam new to ruby on rails I read the one of the article in mail program.iam trying to execute the program it shows the errors.here the error is execution expired RAILS_ROOT: C:/emailexample Application Trace | Framework Trace | Full Trace C:/Ruby186/lib/ruby/1.8/timeout.rb:60:in `

[Rails] Re: Scalability of Rails

2011-04-25 Thread Ryan Wilcox
On Apr 25, 12:25 pm, jcBAM wrote: > I was told Ruby on Rails has limitation in scalability... As does everything else, I would say. A reasonable practice is to build you app, then profile it when it becomes slow. See where the speedups are: maybe it's MySQL settings, more RAM on the servers, mor

Re: [Rails] vendoring rails the good ol' fashioned way

2011-04-25 Thread Conrad Taylor
On Mon, Apr 25, 2011 at 9:35 PM, Josh wrote: > rails 3.0.7 here. > > 'bundle package' dumps 29MB into vendor/cache and 129MB into vendor/ > rails That seems to arbitrary and unnecessary. How do I install > rails to vendor/rails these days? 'rake rails:freeze:gems' used to > work great, now

[Rails] vendoring rails the good ol' fashioned way

2011-04-25 Thread Josh
rails 3.0.7 here. 'bundle package' dumps 29MB into vendor/cache and 129MB into vendor/ rails That seems to arbitrary and unnecessary. How do I install rails to vendor/rails these days? 'rake rails:freeze:gems' used to work great, now what? Tried this: Gemfile: gem 'rails', '3.0.7', :path =>

[Rails] Code an Education Revolution (@Qykno) in 54 hours! Location: San Francisco Bay Area

2011-04-25 Thread Kalimah Priforce
Code an Education Revolution (@Qykno) in 54 hours! Location: San Francisco Bay Area (San Francisco, Oakland, Berkeley) Event: Startup Weekend Education (June 3rd - 5th) On June 3rd - 5th, an event called Startup Weekend Education will gather hackers, hustlers, and designers togethe

[Rails] Re: undefined method error because I am not understanding Rails initializers

2011-04-25 Thread John Merlino
I restarted the server and it appears to have worked. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from

[Rails] Fully qualified table names in ActiveRecord

2011-04-25 Thread Anthony
Hi there, I'm developing an app based on a legacy database in which all the tables were created by a user other than dbo. That means in order to access the tables I need to qualify the table name with the owner name, like so "SELECT table.* from owner.table" The problem is if I use 'set_table_n

[Rails] undefined method error because I am not understanding Rails initializers

2011-04-25 Thread John Merlino
Hey all, In app/builders, I have a file called table_builder.rb. In the constructor method of my TableBuilder class, I call an instance method called assign_attributes which takes a hash and converts the key/value pairs into instance methods. The assign_attributes method is declared in the follow

Re: [Rails] Video tutorial for Ruby on Rails ?

2011-04-25 Thread radhames brito
sample https://rails-tutorial-samples.s3.amazonaws.com/rails_tutorial_sample.mov -- 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

Re: [Rails] Video tutorial for Ruby on Rails ?

2011-04-25 Thread radhames brito
On Mon, Apr 25, 2011 at 5:17 PM, Rodrigo Ruiz wrote: > Hi, I'm new to ruby and to rails, but I know a bit of OOP with java and > objective-c, and a bit of C. > I'm looking for any video classes or opencoursewares about Ruby on Rails. If > anyone can point any to me I appreciate it. > Thanks everyo

Re: [Rails] Re: Video tutorial for Ruby on Rails ?

2011-04-25 Thread Philip Hallstrom
> On Apr 25, 5:08 pm, Rodrigo Ruiz wrote: >> Ya, but those are just a bunch of random videos, I'm looking for something >> more like a class for beginners, something that I can follow continuously. Ryan actually builds on previous episodes quite a bit. And in a lot of examples uses the same rai

[Rails] Re: Video tutorial for Ruby on Rails ?

2011-04-25 Thread Austin
Hey Rodrigo, I'm not aware of any formalized screencasts that go in a specific lesson order, but Pragmatic Screencasts (http://pragprog.com/ screencasts) may be "close enough" to what you're looking for. If you're looking for stuff specific to the Ruby/Rails stack, check out Ruby Metaprogramming,

Re: [Rails] Re: Video tutorial for Ruby on Rails ?

2011-04-25 Thread Rodrigo Ruiz
Ya, but those are just a bunch of random videos, I'm looking for something more like a class for beginners, something that I can follow continuously. On Mon, Apr 25, 2011 at 6:30 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Apr 25, 10:17 pm, Rodrigo Ruiz wrote: > > Hi, I'm

Re: [Rails] validating nested models

2011-04-25 Thread David Kahn
On Mon, Apr 25, 2011 at 5:58 PM, Mlle wrote: > Hi > > I'm using Rails 2.3 and I want to validate that a nested model's > attribute is numerical. > How do I do that and then catch the error if there is one? > Give this a try, I think if you use the form builder and standard validation messages, a

[Rails] validating nested models

2011-04-25 Thread Mlle
Hi I'm using Rails 2.3 and I want to validate that a nested model's attribute is numerical. How do I do that and then catch the error if there is one? Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send e

[Rails] Re: Nothing being logged in production.log

2011-04-25 Thread amit_saxena
Thanks Colin for the help :) Figured it out, while trying random things. Probably was a permissions issue and was resolved on changing the permissions from 644 to 666; but interestingly no error was being thrown out that passenger was unable to write to log file in the apache error logs. Interest

[Rails] Postgres Timestamp Fields Displayed with Time format

2011-04-25 Thread Lee
I have Time fields in my PostgreSQL tables, which I force to display as time only with this entry in config/locales/en.yml: time: formats: default: "%H:%M:%S" Problem is, that format is now applied to Timestamp fields, including the default created_at and updated_at fields. Why is i

Re: [Rails] Re: Video tutorial for Ruby on Rails ?

2011-04-25 Thread jason white
http://net.tutsplus.com/articles/web-roundups/essential-ruby-rails-3-reading-3/ On Mon, Apr 25, 2011 at 4:30 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Apr 25, 10:17 pm, Rodrigo Ruiz wrote: > > Hi, I'm new to ruby and to rails, but I know a bit of OOP with java and > > o

[Rails] Re: Video tutorial for Ruby on Rails ?

2011-04-25 Thread Frederick Cheung
On Apr 25, 10:17 pm, Rodrigo Ruiz wrote: > Hi, I'm new to ruby and to rails, but I know a bit of OOP with java and > objective-c, and a bit of C. > > I'm looking for any video classes or opencoursewares about Ruby on Rails. If > anyone can point any to me I appreciate it. There are many videos

[Rails] Rails 3 remote_function

2011-04-25 Thread gerbdla
Hi I am hoping someone can help me with this. We are upgrading to rails 3 and have decided to stay with prototype. We are using remote_function like this as an example <%= remote_function("/users/#{@user.id}/ recent_news", :method=>:get, :update=>"user_recent_news_#{@user.id}") %>; this is return

[Rails] Video tutorial for Ruby on Rails ?

2011-04-25 Thread Rodrigo Ruiz
Hi, I'm new to ruby and to rails, but I know a bit of OOP with java and objective-c, and a bit of C. I'm looking for any video classes or opencoursewares about Ruby on Rails. If anyone can point any to me I appreciate it. Thanks everyone. -- You received this message because you are subscribed

Re: [Rails] Scalability of Rails

2011-04-25 Thread David Kahn
On Mon, Apr 25, 2011 at 11:25 AM, jcBAM wrote: > I was told Ruby on Rails has limitation in scalability. What exactly > is hindering RoR to scale up (is it true that Twitter switched from > RoR to Scala)? Any solution or active projects to resolve scalability > issues? > Well, if you have a sp

[Rails] Re: Scalability of Rails

2011-04-25 Thread UNIXgod
Nope Twitter didn't switch. They still run Ruby on Rails. They also use scala as they run rails under the jvm AFAIK. If you really want the skinny google is your friend here. On Apr 25, 11:25 am, jcBAM wrote: > I was told Ruby on Rails has limitation in scalability.  What exactly > is hindering R

[Rails] Re: perform a check and then call super class when user creates new session

2011-04-25 Thread John Merlino
While I almost got the behavior I want, there's a problem: def create @user = User.authenticate(params[:user]) if !@user.enabled render "shared_navigation/confirmation" elsif request.post? #just using else instead of elsif request.post? gives same unwanted behavior sup

Re: [Rails] Re: TextMate vs EMACS vs RadRails

2011-04-25 Thread Stu
vi + command prompt seems to work well for me. -- 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+unsubsc

[Rails] Scalability of Rails

2011-04-25 Thread jcBAM
I was told Ruby on Rails has limitation in scalability. What exactly is hindering RoR to scale up (is it true that Twitter switched from RoR to Scala)? Any solution or active projects to resolve scalability issues? -- You received this message because you are subscribed to the Google Groups "Ru

[Rails] Re: Extremely slow start up with ruby 1.9.1 vs 1.8.7

2011-04-25 Thread Roger Pack
> Using ruby-prof I captured the CPU time of the startup of my 3.0.3 > Rails app (https://gist.github.com/762764): > ... > ruby-1.9.2-p136 (Total CPU 16.794391) > > %self total self waitchildcalls name > 39.93 16.47 6.71 0.0016.46 1904 Kernel#require >

[Rails] Re: mysql key too long error

2011-04-25 Thread Mike C
Nevermind, I got it. I just have to test to see if it works. Thanks for your help! On Apr 24, 3:49 pm, Mike C wrote: > Oh, I was looking for an example of how to use it like a piece of code > or something. > > On Apr 24, 7:51 am, Frederick Cheung > wrote: > > > > > On Apr 24, 9:23 am, Mike C wr

[Rails] Re: Date from user input

2011-04-25 Thread Tom Ricks
I must have made some mistake because I checked if request.post? Date.new(params[:year].to_i, params[:month].to_i, params[:day].to_i) end again and it does not call an error either. However anytime I input any numbers into the fields, i get the same invalid date error. Is there something wrong

[Rails] Re: Date from user input

2011-04-25 Thread Tom Ricks
Tim Shaffer wrote in post #994920: > The easiest way is probably just "if request.post?" > > Be careful though - it could be a post request without the parameters > you > are looking for. Might also be helpful to check if the params hash > contains > the keys you plan on using. > > Another option i

[Rails] Re: Date from user input

2011-04-25 Thread Tim Shaffer
The easiest way is probably just "if request.post?" Be careful though - it could be a post request without the parameters you are looking for. Might also be helpful to check if the params hash contains the keys you plan on using. Another option is to just try it, then ask for forgiveness: beg

[Rails] perform a check and then call super class when user creates new session

2011-04-25 Thread John Merlino
Hey all, I'm using devise plugin for rails. When the user creates a new session, in addition to devise authenticating the user, I want to check if the user is enabled by checking the value of the enabled (a boolean) field in the database. If the value is 0, I want to alert user that they haven't b

[Rails] Re: Date from user input

2011-04-25 Thread Tom Ricks
Tim Shaffer wrote in post #994906: > On Monday, April 25, 2011 12:00:43 PM UTC-4, Ruby-Forum.com User wrote: >> >> I find this odd because I haven't even inputted any variables in the >> view yet the date is invalid? >> > > Actually that's probably exactly why you have an invalid date. If you > hav

[Rails] Problem w/ routing constraints

2011-04-25 Thread Clem Rock
Hello, I am having a strange problem w/ rails 3 routing constraints. I have this custom class w/ a self.matches? method as such: [code] class PersonalizedDomain def self.matches?(request) Rails.logger.info("self.matches? NEVER CALLED") end [/code] and in routes I use the custo

[Rails] Problem w/ routes constraints

2011-04-25 Thread clem_c_rock
Hello, I am having a strange problem w/ rails 3 routing constraints. I have this custom class w/ a self.matches? method as such: [code] class PersonalizedDomain def self.matches?(request) Rails.logger.info("self.matches? NEVER CALLED") end [/code] and in routes I use the cust

[Rails] Re: Date from user input

2011-04-25 Thread Tim Shaffer
On Monday, April 25, 2011 12:00:43 PM UTC-4, Ruby-Forum.com User wrote: > > I find this odd because I haven't even inputted any variables in the > view yet the date is invalid? > Actually that's probably exactly why you have an invalid date. If you haven't input any variables yet, params hash wil

[Rails] Re: undefined method 'match' with the Linkedin Gem

2011-04-25 Thread Bruno Amaral
On Apr 23, 10:12 pm, Frederick Cheung wrote: > > >         has_many :authentications > >         has_many :positions, :class_name =>LinkedIn::Position::Resource > > This looks wrong, since :class_name is supposed to be a string > andLinkedIn::Position::Resource isn't However, not using it only

[Rails] Date from user input

2011-04-25 Thread Tom Ricks
Hello, I am trying to create a Date instance from user input, but I keep getting the ArgumentError invalid date. Here's the simplified version: View: <%= form_tag "/" do %> <%= number_field_tag(:month) %> <%= number_field_tag(:day) %> <%= number_field_tag(:year) %> <%= submit_tag "Date" %> <

Re: [Rails] Re: NoMethodError in Book

2011-04-25 Thread Colin Law
On 25 April 2011 16:50, amrit pal pathak wrote: > > > On Apr 25, 9:37 am, Tim Shaffer wrote: >> Actually it looks like you're not defining it in the example you provided. >> >> Your controller is defining a variable called @book, but your view is trying >> to reference a variable called @post. Do

[Rails] Re: NoMethodError in Book

2011-04-25 Thread amrit pal pathak
On Apr 25, 9:37 am, Tim Shaffer wrote: > Actually it looks like you're not defining it in the example you provided. > > Your controller is defining a variable called @book, but your view is trying > to reference a variable called @post. Do you have a PostsController? Yes it was mist

[Rails] Re: Rails3 how to scope it, using a serialized array ?

2011-04-25 Thread Frederick Cheung
On Apr 25, 1:18 pm, Erwin wrote: > Thanks Fred for your advice .. this is what I finally did... > I just keep serializing parameters for being used with a proxy object > connector to external services , as the parameters to be used are > different from one connector to another one... You might

[Rails] Re: Multi-database use and additional connections

2011-04-25 Thread Frederick Cheung
On Apr 25, 4:03 pm, PsiPro wrote: > Hello all, > > I have a single tableless class that is drawing information from an > oracle db and importing it into my local posgres database. > > This DataFetch class is not inherited from AR:Base, but I was hoping > to use some of the AR magic. Currently du

[Rails] Multi-database use and additional connections

2011-04-25 Thread PsiPro
Hello all, I have a single tableless class that is drawing information from an oracle db and importing it into my local posgres database. This DataFetch class is not inherited from AR:Base, but I was hoping to use some of the AR magic. Currently during initialization I am running: @connectio

[Rails] Re: I need advice to desining website with ROR

2011-04-25 Thread hoboy Hoboy
Hej Jens well the chapter 5 of this book http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:structure really answer to my questions. Tks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk

[Rails] Re: NoMethodError in Book

2011-04-25 Thread Tim Shaffer
Actually it looks like you're not defining it in the example you provided. Your controller is defining a variable called @book, but your view is trying to reference a variable called @post. Do you have a PostsController? -- You received this message because you are subscribed to the Google Grou

[Rails] Re: NoMethodError in Book

2011-04-25 Thread amrit pal pathak
On Apr 25, 9:01 am, Tim Shaffer wrote: > What does your controller look like? Do you define the @post variable? Yes i defined it.it looks like class BookController < ApplicationController def index @book =Book.all render :index end end Thanks -- You received this me

[Rails] Re: NoMethodError in Book

2011-04-25 Thread Tim Shaffer
What does your controller look like? Do you define the @post variable? -- 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

[Rails] NoMethodError in Book

2011-04-25 Thread amrit pal pathak
I got a following error. NoMethodError in Book#new Showing /home/amrit/boook/app/views/book/_form.html.erb where line #1 raised: undefined method `model_name' for NilClass:Class The content of _form.html.erb file are: <%= form_for(@post) do |f| %> <% if @post.errors.any? %> <%=

[Rails] NoMethodError in Book

2011-04-25 Thread amrit pal pathak
I got a following error. NoMethodError in Book#new Showing /home/amrit/boook/app/views/book/_form.html.erb where line #1 raised: undefined method `model_name' for NilClass:Class The content of _form.html.erb file are: <%= form_for(@post) do |f| %> <% if @post.errors.any? %> <%=

Re: [Rails] Re: How to get http details in rails

2011-04-25 Thread Tim Shaffer
Sorry, that example should have been <% for header in request.env.select { |key, val| k.match("^HTTP.*")} %> <%= header[0] %> <%= header[1] %> <% end %> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send emai

Re: [Rails] Re: How to get http details in rails

2011-04-25 Thread Tim Shaffer
I guess I'm not understanding the question. If you want to access a HTTP header such as HTTP_USER_AGENT, you can just pull it out of the request.env hash: puts request.env["HTTP_USER_AGENT"] Does it matter that there are other rails keys in the hash? You can also print all the headers beginnin

[Rails] Re: TextMate vs EMACS vs RadRails

2011-04-25 Thread Alexey Poimtsev
+1 => RubyMine + MacVim :) On Apr 23, 1:39 am, jason white wrote: > +1 for RubyMine > by the way, it's on sale until this Sunday for 50% off > > > > > > > > On Fri, Apr 22, 2011 at 3:56 PM, Paul wrote: > > This is a holy war that starts up about every other week on this list. > > You'll find peo

Re: [Rails] CalendarDateSelect Error:

2011-04-25 Thread Colin Law
On 25 April 2011 10:46, Hemant Bhargava wrote: > Hello All, > > I guess you guys can light me up better than google. I am getting a > pop-up when i introduced full_calendar functionality in my app. The > pop-up message is:- > > CalendarDateSelect Error: Prototype could not be found. Please make su

[Rails] Re: Rails3 how to scope it, using a serialized array ?

2011-04-25 Thread Erwin
Thanks Fred for your advice .. this is what I finally did... I just keep serializing parameters for being used with a proxy object connector to external services , as the parameters to be used are different from one connector to another one... On 23 avr, 17:45, Frederick Cheung wrote: > On Apr 23

Re: [Rails] Re: How to get http details in rails

2011-04-25 Thread loganathan sellappa
hi , Thanks for your reply,but still i got the rails related headers such as "rack.session"=>{:admin=>#, is their anyway to get only basic http headers exactly,the below is th o/p of request.env {"rack.session"=>{:admin=>#, :session_id=>"08f6c3b78700a2bce362b79853cb3dfa

[Rails] Re: Could not generate a form

2011-04-25 Thread amrit pal pathak
On Apr 24, 1:07 pm, Colin Law wrote: > On 24 April 2011 17:29, amrit pal pathak wrote: > > > > > > > > > > > ... > >        i read again and now try it myself.Exactly follow the > > tutorils and try to make changes in new ror app.please go through what > > i have done. > >     1) add following

[Rails] Re: How to get http details in rails

2011-04-25 Thread Tim Shaffer
The headers you're looking for should be available in request.env request.env["HTTP_ACCEPT"] request.env["HTTP_HOST"] request.env["HTTP_USER_AGENT"] -- 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 ru

Re: [Rails] I need advice to desining website with ROR

2011-04-25 Thread Jens
Hi, you should take a look at the RoR-Guides ( http://guides.rubyonrails.org/layouts_and_rendering.html), there is a good description of what you can do with layout files. If you have any more questions after reading this, please come back and ask again. Regards Jens On Mon, Apr 25, 2011 at 8:14

[Rails] Re: TextMate vs EMACS vs RadRails

2011-04-25 Thread hoboy Hoboy
Well, is it only TextMate you want for ide ? I am also new to RoR I am a java and .Net developer. So I needed an IDE to start RoR, my solution has been Netbeans 7 with a plugin from this site http://blog.enebo.com/ , so far this is working very fine for me, and also Netbeans 6.9.1 works, I have u

Re: [Rails] RACK: adding a query parameter before call

2011-04-25 Thread Max Schubert
Is this some kind of initialization code that needs to be called when the app is started? On 4/24/11, rails.n...@gmail.com wrote: > Hmmm.. should I focus on adjusting the request or the 'env' > variable when I call the app? > > -- > You received this message because you are subscribed to the

[Rails] CalendarDateSelect Error:

2011-04-25 Thread Hemant Bhargava
Hello All, I guess you guys can light me up better than google. I am getting a pop-up when i introduced full_calendar functionality in my app. The pop-up message is:- CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (.g.

[Rails] Re: I need advice to desining website with ROR

2011-04-25 Thread hoboy Hoboy
Tks Robert. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-tal

[Rails] Re: I need advice to desining website with ROR

2011-04-25 Thread Robert Pankowecki (rupert)
Use layouts and/or partials http://guides.rubyonrails.org/layouts_and_rendering.html http://guides.rubyonrails.org/getting_started.html Robert Pankowecki -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email