Displaying 20 results from an estimated 30000 matches similar to: "Rails 3 ActiveRecord queries - I'm missing something very BIG"
2012 Jun 30
5
Problems with associations
Hello guys, I have two tables, tasks and projects, and each model I put:
Task.rb
class Task < ActiveRecord::Base
attr_accessible :user_id, :project_id, :name
belongs_to :project
end
Project.rb
class Project < ActiveRecord::Base
attr_accessible :name, :description
has_many :tasks
end
But when I go to my prompt and I make a SELECT with task, none project
is returned.
2011 Sep 28
3
Error : bundle install
c:proj/proj1> bundle install
Fetching source index for http://rubygems.org/
Could not find sprockets-2.0.0.beta.10 in any of the sources
C:proj/proj1>
C:proj/proj1>gem install sprockets -v=2.0.0.beta.10
ERROR: Could not find a valid gem ''sprockets'' (= 2.0.0.beta.10) in any
reposito
ry
ERROR: Possible alternatives: sprockets
C:proj/proj1>gem install sprockets
2013 May 14
5
Why joins queries make result readonly?
Are there any rationalies to make queries obtained by joining scope to be
readonly? I read some old posts (pre-rails3) that joins adds additional
columns to record so that ActiveRecord doesn''t know how to update that
fields, but actually I don''t see that fields. For example I write model
class Order < ActiveRecord::Base
has_and_belongs_to_many :executors, class_name:
2010 Dec 20
2
The Rails3 way for in-place editing
Currently I want to implement in-place editing directly on the index-page
(for the sake of learning just xx products with a name to be edited).
These are my favorite links from yesterday''s research (for the archives):
*On the spot is a Rails3 compliant unobtrusive javascript in-place-editing
plugin: http://rubygems.org/gems/on_the_spot
2011 Aug 23
13
Is OSX Lion a valid choice yet? Any issues?
Hi,
My Snow Leopard just let me down and now it could be a "good" moment to
upgrade to Lion.
But I''m not sure is it an option yet.
I would be using Rails 3.0.9, Ruby 1.9.2 via RVM. Postgresql DB. And
probably some stuff via homebrew. Git, Versions and that type of stuff.
Are the lights red for Lion since it is so fresh?
Any experiences?
Thanks.
--
Posted via
2011 Mar 07
4
Railscasts down?
I have not been able to get railscasts.com recently, surely it has not
been taken down also, along with the wiki.
Colin
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2010 Jan 08
6
How to change a rails app to INstant rails app???
i have a rails app , i need to change that app to instant rails app.
i have been using Net beans as IDE
is der an easy step to do that???
rather creating a new one by copy paste?
--
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
2006 Jun 19
4
DateTimes get converted to Dates in XML-RPC????
Hi all -
I have written an XML-RPC app using action-web-service. Mostly works
well. Except I just noticed that my :datetime types are coming back as
:date types.
That is, when in the console I query the record via Foo.find_by_id(123) I
get back actual datetimes. If I then do it via XML-RPC, fetching that
same record I get back dates (ie. hour/minute/second are set to 00:00:00)
Any ideas?
2012 Aug 01
2
'redirect_to' taking infinite loop.
Hi,
The following controller method taking me into infinite loop. Once the
update action completes I want to reload the ''index'' page. May I know
why it is going into infinite loop?
def update
Device.find_by_id( params[:device_id] ).driver = (
params[:driver_id] == 0 ) ? nil : Driver.find_by_id( params[:driver_id]
)
redirect_to :action => :index, :tab =>
2010 Jun 17
7
Why do rails calls a method when I'm calling a property?
Well, I''m starting on RoR, so I got a Book called simply
rails...Following the steps in it sometimes when I try to call a
property, the browser shows me the next exception:
undefined method `name'' for nil:NilClass
I don''t know why...here''s my controller:
#Controller starts here
class StoriesController < ApplicationController
before_filter :login_required,
2010 Sep 02
1
Error No such file or directory
Hi,
I have a website deployed on heroku, but my local git repository was
ereased, so I m trying to create a new local repository pulling my
deployed site. I run : git clone -o heroku git-Vgi1d2+GxVTQT0dZR+AlfA@public.gmane.org:my_app.git,
but now when I run script/server I get this error msg:
pedro@ubuntu:~/proj/my_app$ script/server
=> Booting WEBrick
=> Rails 2.3.8 application starting
2011 Nov 15
3
create e menu for navigation.
Do you know if there is a gem for creating menu navigations?
I''ve tried simple_navigation but it''s too simple.
I like menu navigation of active_admin gem but I don''t know how to create 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
2010 Jun 04
4
Mac OS/X and Rails 3 ?
Hello List,
Label me a newb, but how do you install Rails 3 on your Mac?
Google sent me to these URLs:
http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release/
http://guides.rails.info/3_0_release_notes.html
http://asciicasts.com/episodes/200-rails-3-beta-and-rvm
From early Feb 2010 I see this short recipe:
gem install tzinfo builder memcache-client rack rack-test rack-mount
erubis mail
2011 Apr 05
2
"Lazy" image resizing?
I''m looking at Dragonfly, which seems to offer what I''m looking for in
this area: the ability to upload an image, then later request that
image at a different geometry, and either get a cached copy of that
resized image, or create and cache that image.
Can anyone point me to alternatives? Is this something that can be
added to Paperclip? I''ve only ever used
2010 May 13
6
to "loop through" the instance variables of ActiveRecord?
to wrap each instance variable of an ActiveRecord object between "<td>"
and "</td>", is there a way to "loop through" them, at least in the
debug mode, no matter there is getter methods to get them or not, or at
least the ones with the getter methods?
Such as
<% @stories.each do |s| %>
<%= "<tr>" %>
<% s.each_property
2011 May 20
5
views w locale default template
[RAILS3]
I hesitate on how handling the locale view templates to default to
one language only ..
sending admin emails will go only to one locale ''en_GB''
should I set it up into the template name and set I18n.locale to
''en_GB''
membership_renew.en_GB.html.erb
OR
whatever locale is used , if I have :
membership_renew.html
it will be the default ?
--
2012 Feb 14
4
What I'm doing wrong, has_and_belong_to_many
Hello, I''m trying to insert into my migrate but when I try on rails
console this error shows:
1.9.3-p0 :001 > group = Group.new
=> #<Group id: nil, name: nil, description: nil, created_at: nil,
updated_at: nil>
1.9.3-p0 :002 > group.name = "Group Name"
=> "Group Name"
1.9.3-p0 :003 > group.description = "Description"
=>
2011 Oct 11
10
Create Two objects at the same time
I have user model and referral model. Referral model has user_id as
field.
Now when a new user is created, I need to call referral#create as well
and pass it the id of the newly generated user to user_id of referral
model. How can I do that.
--
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
2009 Dec 28
2
Override .find, .find_by_id, etc...
I read these:
http://www.ruby-forum.com/topic/185297#new
http://www.freezzo.com/2008/05/14/override-default-find-conditions-for-model/
it works, it override the .find perfectly, however it does not cover
.find_by_id or other .find_by_XXX
Is there anyway to override all the find function of a modal? I want to
set the default "select" for User modal, only return name and id, but
not the
2012 Apr 17
6
ActiveRecord with different Date/Time format
I have an application where user sets his/her preferred date/time
format. User is expected to enter datetime in his preferred format
across the application. Now the problem is for few formats the datetime
is parsed wrongly while create/update ActiveRecord.
For example user has set date/time format in hh:mm dd/MM/yyyy. Now if
user enters 17:00 04/05/2012 it parses it as 5 PM 5 Apr, 2012 where it