[Rails] Re: TypeError: can't convert nil into Integer

2011-05-11 Thread Frederick Cheung
On May 12, 4:46 am, Tim Uckun wrote: TO `people` (`date_of_birth`, `updated_at`, `gender`, > `date_of_death`, `created_at`, `hash`, `first_name`, `middle_name`, > `age`, `status`, `last_name`, `email`, `state`) VALUES (NULL, > '2011-05-12 03:39:33', NULL, NULL, '2011-05-12 03:39:33', NULL, 'tim'

[Rails] How to use LDAP with htaccess file in rails

2011-05-11 Thread Wayne Marquette
Can anyone help me set up LDAP using .htaccess method is Ruby on Rails. I have been looking on line for hours and there are some examples, but know examples explain where to put things in the rails directories and what file names to use. I have seen references to ruby-net-ldap as well, but the

[Rails] Re: Recurring Billing API Integration w/ SAAS provide, i.e. Cheddargetter

2011-05-11 Thread quirk
I believe this gem may be your best bet: http://rubygems.org/gems/cheddargetter_client_rails The documentation is better on the developer's github site: https://github.com/BrentW/cheddargetter_client_rails AQ On May 11, 3:52 pm, Linda wrote: > Happy Spring All > I need to implement a recurring

Re: [Rails] RVM installation

2011-05-11 Thread Colin Law
On 12 May 2011 00:35, Alex Katebi wrote: > The problem is not Ubuntu. It is rvm. The line that you are suppose to add > to your .bashrc has changed: > > user$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" > # Load RVM function' >> ~/.bash_profile > > Now you are suppose to

Re: [Rails] Re: Call a task when server starts

2011-05-11 Thread News Aanad
Can you tell me that how many times the server loads all the files? Because when I start the server it execute the same code multiple times after some period of time. On Wed, May 11, 2011 at 9:46 PM, Tim Shaffer wrote: > That actually makes sense. Rails waits for the initializer to finish > run

[Rails] TypeError: can't convert nil into Integer

2011-05-11 Thread Tim Uckun
I am getting this error with a very simple model and schema. The record saves even though an error has been generated. I have tried this with both postgres and mysql. Here is the model. class Person < ActiveRecord::Base end Here is a transcript.. p = Person.new => # ree-1.8.7-2011.03 :002 > p

Re: [Rails] Webrick script/server file does not exist

2011-05-11 Thread maria johns
Thank you very much. I realize it now. Maria On Wed, May 11, 2011 at 2:52 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On 10 May 2011, at 19:12, Maria wrote: > > > Hello all, > > I worked fairly enough with PHP and MySQL, but am very new to Ruby. > > I have Windows machine wit

Re: [Rails] Re: Webrick script/server file does not exist

2011-05-11 Thread maria johns
Thank you very much. I realize it now. Maria On Wed, May 11, 2011 at 4:01 AM, Javix wrote: > Started from Rails 3, the syntax to start a server is: > > rails server > > or shorter: > > rails s > > Regards > > On May 10, 7:12 pm, Maria wrote: > > Hello all, > > I worked fairly enough with PHP an

Re: [Rails] Webrick script/server file does not exist

2011-05-11 Thread maria johns
Thank you very much. I realize it now. Maria On Wed, May 11, 2011 at 5:04 PM, Norm Scherer wrote: > You are running rails 3. The command to start the server is 'rails > server'. > > > On 05/10/2011 11:12 AM, Maria wrote: > >> Hello all, >> I worked fairly enough with PHP and MySQL, but am very n

[Rails] polymorphic and sti problems.

2011-05-11 Thread Perry Smith
I'm way back at Rails 2.3.5. I can move up to 2.3.11 if anyone thinks that will help. My problem is this: class Entity < ActiveRecord::Base belongs_to :item, :polymorphic => true end class Name < ActiveRecord::Base has_one :entity, :class_name => "Entity", :as => :item

Re: [Rails] RVM installation

2011-05-11 Thread Alex Katebi
The problem is not Ubuntu. It is rvm. The line that you are suppose to add to your .bashrc has changed: user$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile Now you are suppose to run it from a shell. The old way was: [[ -s "$HOME/.

Re: [Rails] Webrick script/server file does not exist

2011-05-11 Thread Norm Scherer
You are running rails 3. The command to start the server is 'rails server'. On 05/10/2011 11:12 AM, Maria wrote: Hello all, I worked fairly enough with PHP and MySQL, but am very new to Ruby. I have Windows machine with Apache and MySQL installed previously. Both Apache and MySql were stopped w

Re: [Rails] Re: Extending/reopeining class and use of super

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 3:29 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > On May 11, 7:01 pm, David Kahn wrote: > > On Wed, May 11, 2011 at 12:52 PM, Frederick Cheung < > > > > frederick.che...@gmail.com> wrote: > > > > > On 11 May 2011, at 18:17, David Kahn > wrote: > > > > > A q

Re: [Rails] RVM installation

2011-05-11 Thread Colin Law
On 11 May 2011 16:58, Cássio wrote: > Hello, after upgrading to ubuntu 11.04 im having this problem with > rvm. Im following this tutorial: > http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#top > > Git is installed OK, when I follow the instructions on RVM website > aparently its OK too,

[Rails] Re: Extending/reopeining class and use of super

2011-05-11 Thread Frederick Cheung
On May 11, 7:01 pm, David Kahn wrote: > On Wed, May 11, 2011 at 12:52 PM, Frederick Cheung < > > frederick.che...@gmail.com> wrote: > > > On 11 May 2011, at 18:17, David Kahn wrote: > > > A question on a couple things relating to extending a class and the use of > > super. > > > In my main applic

[Rails] RVM installation

2011-05-11 Thread Cássio
Hello, after upgrading to ubuntu 11.04 im having this problem with rvm. Im following this tutorial: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#top Git is installed OK, when I follow the instructions on RVM website aparently its OK too, but when I close my terminal and open a new one

[Rails] Recurring Billing API Integration w/ SAAS provide, i.e. Cheddargetter

2011-05-11 Thread Linda
Happy Spring All I need to implement a recurring billing solution w/ API of Cheddargetter. As a ruby nuby, I haven't do any API integration and payment solution before. I watched railscasts about Paypal and active merchant (all in rails 2), however still a bit over my head in terms of what to do

[Rails] [Model Scopes] How to count a nested

2011-05-11 Thread danimashu
Hello, I have a Post that has_many Comments. I have the next scopes: scope :valid, where('created_at >= ?', 2.months.ago) scope :expired, where('created_at < ?', 2.months.ago) Now, I would have a scope named :commented that return all the Post that have more than 0 Comments but I don't know how d

[Rails] Re: Running Ruby/Rails Specs with database inserts from non-default spec sub-directory

2011-05-11 Thread egervari
> There is a gem called database_cleaner which might help in your case to run > before your test/suite. Well, I'm looking into that now... and it mostly works (But not quite... it seems like there are some records hanging around still). Why do I not need the database cleaner for the model tests..

Re: [Rails] Duplicate method in application_controller and application_helper

2011-05-11 Thread Walter Davis
Never mind, found helper_method. So now I have helper_method :current_practice in my ApplicationController, and it magically appears in the ApplicationHelper as well. Walter On May 11, 2011, at 2:34 PM, Walter Lee Davis wrote: I have a method: def current_practice if session[:imperson

Re: [Rails] Running Ruby/Rails Specs with database inserts from non-default spec sub-directory

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 1:54 PM, egervari wrote: > Hi everyone! > > I have a question on how to setup my tests a bit differently than the > defaults. > > By default, Rails with RSpec installed provides you with directories > such as spec/models, spec/controllers, etc. > > When i use before(:each)

[Rails] Running Ruby/Rails Specs with database inserts from non-default spec sub-directory

2011-05-11 Thread egervari
Hi everyone! I have a question on how to setup my tests a bit differently than the defaults. By default, Rails with RSpec installed provides you with directories such as spec/models, spec/controllers, etc. When i use before(:each), I notice that Rails properly cleans out the database in these sp

[Rails] Duplicate method in application_controller and application_helper

2011-05-11 Thread Walter Lee Davis
I have a method: def current_practice if session[:impersonating] Practice.find session[:impersonating] else current_user.practice end end It is identical in both controller and helper. How could I DRY this up so I only need maintain it in one place? I already have

Re: [Rails] Re: Regex Validation

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 10:26 AM, Fred Ballard wrote: > +1 to everything Walter has said, as well. > > I haven't thought about this a lot, but doesn't this apply to everything in > terms of user input? Doesn't this really enter the realm of a basic > guideline, principle, or law for UI? (I rememb

Re: [Rails] Extending/reopeining class and use of super

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 12:52 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > On 11 May 2011, at 18:17, David Kahn wrote: > > A question on a couple things relating to extending a class and the use of > super. > > In my main application I have the following class which extends an en

Re: [Rails] Extending/reopeining class and use of super

2011-05-11 Thread Frederick Cheung
On 11 May 2011, at 18:17, David Kahn wrote: > A question on a couple things relating to extending a class and the use of > super. > > In my main application I have the following class which extends an engine > class: You are reopening the class (ie adding/changing methods in User), not subc

Re: [Rails] help with validations

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 2:36 AM, Quee WM wrote: > Hi, > > I am trying to use the new rails 3 validations and running into some > issues. > > for my password I have, > > validates :password,:presence => {:on => :create}, :length => { > :minimum => 5, :maximum => 16 }, :confirmation => true >

Re: [Rails] Rails 3 Routes

2011-05-11 Thread Walter Davis
Not if you're grabbing it from somewhere. The ID MUST be somewhere, or the find will fail. @user = current_user if you're using any sort of common authentication framework. From there, @user.posts is a drop-kick away. Walter On May 11, 2011, at 12:28 PM, Chad Eubanks (gMail) wrote: Very

[Rails] Extending/reopeining class and use of super

2011-05-11 Thread David Kahn
A question on a couple things relating to extending a class and the use of super. In my main application I have the following class which extends an engine class: class User < ActiveRecord::Base def self.find_for_database_authentication(login_value, omniauth_provider=nil, omniauth_uid=nil)

Re: [Rails] Rails 3 Routes

2011-05-11 Thread Chad Eubanks (gMail)
Very true... The session controller would do such. But the question still lingers, does the id NEED to be in the url? Kind Regards, Chad Eubanks Sent from my iPhone On May 11, 2011, at 9:20 AM, Walter Davis wrote: > > On May 11, 2011, at 11:00 AM, Chad Eubanks (gMail) wrote: > >> Thi

Re: [Rails] unobtrusive javascript -> attaching a .js.erb page

2011-05-11 Thread Chris Mear
On 9 May 2011 14:30, Sergio Ruiz wrote: > i saw on one of the railscasts that using unobtrusive javascript, you > attach your javascript to your page like so: > > if your view is: > > index.html.erb > > you could add a page named: > > index.js.erb > > and that javascript would be included on the l

[Rails] Re: Routes - Search url parser

2011-05-11 Thread danimashu
> I would advise against a strategy that could ever be ambiguous, even > if it looks unlikely at the moment.  It would likely bite you at some > point in the future, or even worse the developer who comes hereafter, > can you imagine what he/she would say about you when he realised the > problem and

Re: [Rails] Rails 3 Routes

2011-05-11 Thread Walter Davis
On May 11, 2011, at 11:00 AM, Chad Eubanks (gMail) wrote: This might be a better example: users/id/posts.json. When user one logs in the related posts are shown. When user two logs in the related posts are shown. However, the id can not be shown in the url. The ID has to be somewhe

Re: [Rails] Re: Autocomplete plugin

2011-05-11 Thread Walter Davis
On May 11, 2011, at 11:27 AM, Mlle wrote: Thanks for your comments. I understand what you're saying but I guess my question had more to do with the population of the actual list, not the database query. If you use the autocomplete plugin, the list that populates under the input box has to be

Re: [Rails] Re: Call a task when server starts

2011-05-11 Thread Tim Shaffer
That actually makes sense. Rails waits for the initializer to finish running before running the rest of your application. So if you have an infinite loop in there, it'll never finish running. Might be best to spawn another process using Thread or just run that code as part of a cron job or othe

Re: [Rails] Help save my marriage ... correct route, so enable MVC logic v's should be regular file, trying to send it

2011-05-11 Thread News Aanad
which tool you are using to develop Rhodes applications? On Wed, May 11, 2011 at 6:53 PM, Jason wrote: > Hi All, > > I've been up until the small hours for the past couple of night trying > to get my Rhodes navigation working! > > In essence I have the following in the root index.erb > > >

[Rails] Re: Autocomplete plugin

2011-05-11 Thread Mlle
Thanks for your comments. I understand what you're saying but I guess my question had more to do with the population of the actual list, not the database query. If you use the autocomplete plugin, the list that populates under the input box has to be a certain field of a certain model. For examp

Re: [Rails] Re: Regex Validation

2011-05-11 Thread Fred Ballard
+1 to everything Walter has said, as well. I haven't thought about this a lot, but doesn't this apply to everything in terms of user input? Doesn't this really enter the realm of a basic guideline, principle, or law for UI? (I remember something like this being applied to database design.) D

Re: [Rails] Constructing an array of stuff (to send multiple apple push notifications)

2011-05-11 Thread Colin Law
On 11 May 2011 08:55, bingo bob wrote: > I'm using this gem https://github.com/justintv/APNS to send push > notifications to an iPhone app and amazingly it works for single > notifications, such that I can do... > > APNS.send_notification(Device.first.device_token,'test message') > > Works great..

[Rails] Re: method_missing in controller

2011-05-11 Thread andreacfm
Thanks. Was is not clear is why the method_missing method is not invoked if I declare it. Looks like rails render the view if exists before checking if a method_missing exists in the controller. Andrea On May 11, 5:12 pm, Frederick Cheung wrote: > On May 11, 2:54 pm, andreacfm wrote: > > > Hi,

[Rails] sequel

2011-05-11 Thread rhossi
anyone using sequel with rails? any references regarding comparing sequel with other solutions(vs ActiveRecord, vs DataMapper and so on)? thanks in advance. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send ema

[Rails] Re: method_missing in controller

2011-05-11 Thread Frederick Cheung
On May 11, 2:54 pm, andreacfm wrote: > Hi, > > I am using a method_missing method into a controller. > I have a route that says: > > match ':controller/:action' > > What surprise me is that if a view that match the action name exists > method_missing is not invoked but rails happily render the v

[Rails] Re: Re: each do js problem

2011-05-11 Thread Neil Bye
Jeffrey L. Taylor wrote in post #997862: "> > > HTH, > Jeffrey Thanks that did the trick but I applied it to Neil -- 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, sen

Re: [Rails] requests hanging

2011-05-11 Thread Alex Katebi
On Wed, May 11, 2011 at 11:05 AM, David Kahn wrote: > > > On Wed, May 11, 2011 at 7:26 AM, Alex Katebi wrote: > >> I think I have found a good solution for my background tasks. >> >> http://kr.github.com/beanstalkd/ >> >> http://railscasts.com/episodes/243-beanstalkd-and-stalker >> >> It's exactly

[Rails] Re: Constructing an array of stuff (to send multiple apple push notifications)

2011-05-11 Thread bingo bob
Any ideas? -- 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-talk

Re: [Rails] requests hanging

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 7:26 AM, Alex Katebi wrote: > I think I have found a good solution for my background tasks. > > http://kr.github.com/beanstalkd/ > > http://railscasts.com/episodes/243-beanstalkd-and-stalker > > It's exactly what I need, and it seems to be a simple and popular solution. >

[Rails] Re: ROR 3 model associations

2011-05-11 Thread Tim Shaffer
If you phrase it slightly differently, the code for associations almost writes itself: Game has one host to class User Game has one visitor to class User User has many hosting games to class Game User has many visiting games to class Game By default when you create an association, rails will us

Re: [Rails] Re: Call a task when server starts

2011-05-11 Thread News Aanad
I agree with you Tim but I have tried this idea. Whats happen is server is started but the service on the particular port is not being start because of that forever loop, this one is being problem in my app. Can u give me any more suggestion? and ya one more thing I don't want to use Thread class.

Re: [Rails] Rails 3 Routes

2011-05-11 Thread Chad Eubanks (gMail)
Fred, I understand I can not get rid of it completely. The reason I am asking this is this: I have a client side app that sets a proxy to the URL path with an extension .json. The events id is not a constant integer and therefore I can not set the proxy URL to an explicit events id. I n

Re: [Rails] Re: Regex Validation

2011-05-11 Thread Philip Hallstrom
>> Walter >> Im using address to geocoding. Do you know if exists an address check >> plugin or gem to do this work? >> >> Thanks >> >> Pedro >> > > I repeat my earlier point. If it's not valuable enough to the user, they will > spam you like this. If your geocoder reports an error, then raise

Re: [Rails] Getting null value when it's assigned

2011-05-11 Thread Colin Law
On 11 May 2011 01:19, Tomas R. wrote: > I have my articles migration > > create_table :articles do |t| > t.integer :category_id, :null => false > etc.. > > and my form > > Select a category > <%= f.select :category_id, Category.all.collect {|category| > [category.name, category.id ]} %> > > But ev

Re: [Rails] Re: Regex Validation

2011-05-11 Thread Walter Davis
On May 11, 2011, at 10:18 AM, Pedro wrote: Walter Im using address to geocoding. Do you know if exists an address check plugin or gem to do this work? Thanks Pedro I repeat my earlier point. If it's not valuable enough to the user, they will spam you like this. If your geocoder reports an

[Rails] Re: Regex Validation

2011-05-11 Thread Pedro
Walter Im using address to geocoding. Do you know if exists an address check plugin or gem to do this work? Thanks Pedro On 11 maio, 10:54, Walter Davis wrote: > I don't think a regex can save you here. Ask yourself a higher-level   > question. Why are you gathering the address information, a

[Rails] ROR 3 model associations

2011-05-11 Thread ggroupnick
Hi all, I am new to ROR3 and would really appreciate some advice on how to define the following model association: Game model - has host_userid and visitor_userid as fields to define the two players engaged in the game. this two fields are of type User and need to be mapped

[Rails] method_missing in controller

2011-05-11 Thread andreacfm
Hi, I am using a method_missing method into a controller. I have a route that says: match ':controller/:action' What surprise me is that if a view that match the action name exists method_missing is not invoked but rails happily render the view. I was expecting that method_missing was going to b

[Rails] Help save my marriage ... correct route, so enable MVC logic v's should be regular file, trying to send it

2011-05-11 Thread Jason
Hi All, I've been up until the small hours for the past couple of night trying to get my Rhodes navigation working! In essence I have the following in the root index.erb Model Model2 However, Model and Model2 behave differently, thus: Extract from rholog.tx

Re: [Rails] Re: Call a task when server starts

2011-05-11 Thread Tim Shaffer
I guess it might help to understand what your code is trying to do. But if this is the code you want to execute when the server starts: #do some magic and start the cron You could just put that in an initializer, and it will be executed when the server starts. -- You received this message bec

Re: [Rails] Autocomplete plugin

2011-05-11 Thread Walter Davis
On May 10, 2011, at 7:23 PM, Mlle wrote: Hi Is it possible to use the autocomplete plugin to search using a keyword on more than one field of a model? How can I do that? When you use autocompletion, you define a field to watch, and an endpoint to query against. Whatever query conditions y

Re: [Rails] Regex Validation

2011-05-11 Thread Walter Davis
I don't think a regex can save you here. Ask yourself a higher-level question. Why are you gathering the address information, and why isn't it optional? If it's to send something of value to the person you're requesting it from by postal mail, or if you're using it to help them find somethi

[Rails] Re: Autocomplete plugin

2011-05-11 Thread pepe
If I understand well the question the answer should be yes. If what you mean is if it is possible to use one field on a page to find data in more than one column in the table it should be possible the only thing you would need is to query the table by the columns you desire to query on. On May 10,

[Rails] Re: Getting null value when it's assigned

2011-05-11 Thread pepe
I'm assuming the problem happens when creating new records. Can we see the new and create actions in your controller and the full form in the view? Also, are there any before/after/around filters and/or callbacks that could be affecting the behavior of the application? On May 10, 8:19 pm, "Tomas R

[Rails] Regex Validation

2011-05-11 Thread Pedro
Hi there, Anybody knows how to use regex to validate street name field? I want to avoid things like "st asdkskjfls çsdfksçf". Thanks, Pedro -- 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 rubyonrail

Re: [Rails] Re: Call a task when server starts

2011-05-11 Thread News Aanad
but how can i run that??? my actual code is like: task :start => :environment do #do some magic and start the cron while true do #http_request_and_response_code end end task :stop do #do some more magic and stop IT puts "stops!" end On Wed, May 11, 2011 at 6:52 PM, Tim Shaffer

[Rails] Re: Sign in problem with IE

2011-05-11 Thread Tim Shaffer
What's the specific problem you are having with IE8? Posting some relevant code and error messages may help with troubleshooting. -- 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@googl

[Rails] News Aanad wants to chat

2011-05-11 Thread News Aanad
--- News Aanad wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-b01e394238-6f1d3facf2-IYlUEQAwhdKx3zoyeh5BuVvbsCQ You'll nee

[Rails] Re: Call a task when server starts

2011-05-11 Thread Tim Shaffer
Could you put the code in an initializer? -- 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+unsubscr...@

[Rails] Call a task when server starts

2011-05-11 Thread News Aanad
hi, I am trying to invoke a task when server start but fails to do that. Can any body help me that how to do it? My code is: *path* : app_root/lib/tasks/mytask.rake task :start => :environment do #do some magic and start the cron puts "started!" system("start") end task :stop do #do s

[Rails] Re: Rails 3 respond_with json question

2011-05-11 Thread mikefuzz
That doesn't work. Then it displays this: { -user: { address: null email: "t...@test.com" first_name: "Test" last_name: "Man" status_id: 1 username: "test" } } On May 10, 6:02 pm, mikefuzz wrote: > Hello, > > Having trouble with generating some json. I am trying to render an > single active reco

Re: [Rails] requests hanging

2011-05-11 Thread Alex Katebi
I think I have found a good solution for my background tasks. http://kr.github.com/beanstalkd/ http://railscasts.com/episodes/243-beanstalkd-and-stalker It's exactly what I need, and it seems to be a simple and popular solution. On Tue, May 10, 2011 at 11:43 AM, Alex Katebi wrote: > > > O

Re: [Rails] Rails 3 respond_with json question

2011-05-11 Thread Walter Davis
On May 10, 2011, at 9:02 PM, mikefuzz wrote: Hello, Having trouble with generating some json. I am trying to render an single active record result to json like this: @data = User.find(1) What happens (is there any difference?) if you do this: @data = User.find(1, :include => :status) W

Re: [Rails] Re: changing routes.rb

2011-05-11 Thread Colin Law
On 8 May 2011 13:52, Colin Law wrote: > On 8 May 2011 13:46, Mohamed L. wrote: >> Yeah I had changed to root :to=> and restarted the server. >> >> Ok, my routes.rb= >> >> Debate::Application.routes.draw do >>  resources :posts >> ... >>  # You can have the root of your site routed with "root" >>

[Rails] Update instance variable to actual active record

2011-05-11 Thread Sebastian
I have three models as you can see below. class Watchedfamily < ActiveRecord::Base has_many :watchedmembers, :dependent => :destroy accepts_nested_attributes_for :watchedmembers has_many :old_watchedmembers, :dependent => :destroy accepts_nested_attributes_for :old_watchedmembers end clas

[Rails] Re: Webrick script/server file does not exist

2011-05-11 Thread garibake
Hi, In rails 3 the file in the script folder is called 'rails' and you need to pass in server (or s) as a parameter i.e. ruby script\rails server Hopefully it should now work Gary On May 10, 7:12 pm, Maria wrote: > Hello all, > I worked fairly enough with PHP and MySQL, but am very new to Rub

[Rails] Re: Webrick script/server file does not exist

2011-05-11 Thread Javix
Started from Rails 3, the syntax to start a server is: rails server or shorter: rails s Regards On May 10, 7:12 pm, Maria wrote: > Hello all, > I worked fairly enough with PHP and MySQL, but am very new to Ruby. > I have Windows machine with Apache and MySQL installed previously. > Both Apach

[Rails] Constructing an array of stuff (to send multiple apple push notifications)

2011-05-11 Thread bingo bob
I'm using this gem https://github.com/justintv/APNS to send push notifications to an iPhone app and amazingly it works for single notifications, such that I can do... APNS.send_notification(Device.first.device_token,'test message') Works great... Now it should be a simple task (as per the docs t

[Rails] help with validations

2011-05-11 Thread Quee WM
Hi, I am trying to use the new rails 3 validations and running into some issues. for my password I have, validates :password,:presence => {:on => :create}, :length => { :minimum => 5, :maximum => 16 }, :confirmation => true the presence and length are creating problem. I only want to be