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
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
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 `
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
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 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 =>
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
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
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
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
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
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
> 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
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,
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
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
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
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
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
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
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
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
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
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
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
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
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
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
> 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
>
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
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
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
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
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
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
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
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
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
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
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" %>
<
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
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
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
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
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
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
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
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
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
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? %>
<%=
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? %>
<%=
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
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
+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
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
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
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
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
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
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
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
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
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.
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
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
65 matches
Mail list logo