Re: [Rails] Help with the has_one model implementation

2012-03-31 Thread Bente Pieck
Try rake routes - and you will see, there really isn't defined a student_acounts_path Try: resources :students do resources :accounts end or alternatively in your show (if you want to add a show, edit or update-action in your accounts_controller without an :id param) form_for [@student,

[Rails] Help with the has_one model implementation

2012-03-31 Thread ayesha fernando
I keep getting the following error: NoMethodError in Students#show undefined method `student_accounts_path' for #<#Class:0x007ffe2bf6d688>:0x007ffe2c5e5628> I am trying to implement a has_one model. I followed the rails guide that used the :post has_many :comments example and tweaked it a bit. my

Re: [Rails] Re: Error installing Rails on Ubuntu 11.10 (Gem::DependencyError)

2012-03-31 Thread Leonardo Mateo
On Sat, Mar 31, 2012 at 5:25 PM, Alex Mercer wrote: > gem update --system Actually, that might not work on a Debian based distro if rubygems has been installed via apt packages. That's why I asked how Ruby was installed. -- Leonardo Mateo. There's no place like ~ -- You received this message

Re: [Rails] includes and eager loading not working in simple setup

2012-03-31 Thread Peter Vandenabeele
On Sat, Mar 31, 2012 at 10:28 PM, jenna_s wrote: > Hi, > > I'm having trouble with a simple users-messages setup, where users can > send messages to other users. Here's my class definition: > > class Message < ActiveRecord::Base >  belongs_to :from_user, :class_name => 'User' >  belongs_to :to_use

[Rails] includes and eager loading not working in simple setup

2012-03-31 Thread jenna_s
Hi, I'm having trouble with a simple users-messages setup, where users can send messages to other users. Here's my class definition: class Message < ActiveRecord::Base belongs_to :from_user, :class_name => 'User' belongs_to :to_user, :class_name => 'User' end class User < ActiveRecord::Base

[Rails] Re: Error installing Rails on Ubuntu 11.10 (Gem::DependencyError)

2012-03-31 Thread Alex Mercer
gem update --system On Saturday, March 31, 2012 6:00:19 AM UTC+3, Ruby-Forum.com User wrote: > > I'm trying to install Ruby on Rails on Ubuntu 11.10, but receiving this > error: > > $ sudo gem install rails > ERROR: While executing gem ... (Gem::DependencyError) > Unable to resolv

[Rails] catch a stacked variable by a controller

2012-03-31 Thread ruby LED
hi im new ruby on rails development currently im working with a reservation system to start learning but im currently having a problem with controllers and view first i listed all the menu that the guest added inside the package that he also added i listed them with this _menuadded.html.erb

[Rails] Re: many-to-one relationship

2012-03-31 Thread Robert Walker
"Zoltán Iklódi" wrote in post #1054400: > Hello, > > I want to add a Partner property to more than one type of models (ie. > SalesOrder and PurchaseOrder). > Is this the proper way of defining associatons or there's a simpler > way? What you need here is a polymorphic association. See: http://gu

Re: [Rails] How to set up these associations and nested form

2012-03-31 Thread Peter Vandenabeele
On Sat, Mar 31, 2012 at 7:59 PM, Linus Pettersson wrote: > Hi! > > I'm creating a simple signup form where people can sign up for a camp. They > should be able to add a contact person and also sign up other people (such > as family members). > > Two models: > Application >   has_many :participants

[Rails] How to set up these associations and nested form

2012-03-31 Thread Linus Pettersson
Hi! I'm creating a simple signup form where people can sign up for a camp. They should be able to add a contact person and also sign up other people (such as family members). Two models: Application has_many :participants accepts_nested_attributes_for :participants Participant belongs_to

[Rails] libtiff issues (newb)

2012-03-31 Thread Jeremy Blanchard
Hi all, I am a brand new user here so please accept my apologies if this has already been covered. I have searched extensively for the problem I'm having but cannot find a solution. Also, I am very new to Ruby on Rails. I played around with RoR back in 2008 but never fully got into it. I h

[Rails] many-to-one relationship

2012-03-31 Thread Zoltán Iklódi
Hello, I want to add a Partner property to more than one type of models (ie. SalesOrder and PurchaseOrder). Is this the proper way of defining associatons or there's a simpler way? class Partner < ActiveRecord::Base has_many :sales_orders has_many :purchase_orders end class SalesOrder < Acti

[Rails] Cannot set an attribute in my Join table .... do you think it matters which controller I use?

2012-03-31 Thread rubyshoes
I tried out some code in my console and I am having difficulty translating it for my view and controller so that it gives me the same result. My console: @contract = Contract.new(authnum: "900700", st_date:"2012-01-01", end_date: "2012-30-06") @contract.save @code = Co

[Rails] HTTP Streaming & i18n.t

2012-03-31 Thread Andreas M.
Hello, I want to use HTTP streaming (Rails 3.2.2) to reduce my load time and have tried it successfully, but it doesn't work with I18n.t – the strings are not translated. Don't know why, I guess the relevant code is not loaded at this time. Is there a tutorial / known best way to do I18n with HTTP

[Rails] Re: Rails in a Cloud IDE?

2012-03-31 Thread YogiZoli
I love Cloud based IDEs and really waiting for one which is especially for Rails with RSpec and hopefully with Cucumber integrated well, as well as RVM. Instant Heroku and Capistrano deployment would be great, also SCSS or LESS integration. Thanks for interest, YogiZoli On Mar 30, 6:26 pm, "Simon

[Rails] Missing Template Error on render_to_string - Rails 3.2.2

2012-03-31 Thread nkburdick
Hi, I'm trying to execute some javascript in the browser after completing my create action in the controller. Here's how I'm doing it: In my controller: def create # exectue some code js = render_to_string(:layout => false, :template => "planned_meals/meal.js.coffee.erb") render :js

[Rails] Re: Unable to deploy to Apache

2012-03-31 Thread Kal
My apologies Walter, et al. I haven't had access to my computers within the last 24 hrs. I shall look into your recommendations tonight. As always, thank you for your assistance and prompt replies. ~Kal On Mar 30, 9:26 am, Walter Lee Davis wrote: > On Mar 30, 2012, at 12:34 AM, Kal wrote: >

Re: [Rails] Re: distinctively difficult to do what I want

2012-03-31 Thread Colin Law
On 29 March 2012 17:17, bingo bob wrote: > Schema attached.. > > model summaries... > > class Name < ActiveRecord::Base > >  attr_accessible :given, :gender, :position > >  has_many :user_names >  has_many :users, :through => :user_names > > > class UserNames < ActiveRecord::Base >  belongs_to :us

[Rails] Re: Re: Unable to deploy to Apache

2012-03-31 Thread Firstname L.
Ok this might sound funny but , this problem is usually caused by lack of javascript libraries in your rails setup so i would recommend you to do this . Install this gem and you should be ready to go gem install therubyracer If it works or it doesnt work let me know -- Posted via http://www.

[Rails] I18n.t('countries.NO') broken?

2012-03-31 Thread Sven Schwyn
Hi I've tried this on a virgin Rails 3.2.2 app. If you put the translations for country names in the locale file using the 2 letter ISO code, it looks something like this: en: countries: DE: "Germany" NO: "Norway" US: "USA" This works fine - but for Norway :-) I18n.t :'countries.D