[Rails] New to rails, model design advice needed

2011-09-13 Thread Hank D.
Hi folks. Long time lurker, first time poster. I am taking the plunge into learning rails by scratching a small itch and creating a daily status board for the ambulance service I work for. The daily briefing for a given day will look something like this: http://test.adaptllc.com/stat/index.html

Re: [Rails] bundle install ignoring :git?

2011-09-13 Thread Peter Vandenabeele
On Tue, Sep 13, 2011 at 2:07 AM, Christopher Thielen cthie...@gmail.comwrote: This is possibly OT but I'm confident Rails folks would know the answer. I have a Rails 3.1 site deployed to Apache+Passenger which uses RVM+Bundler. Bundler+RVM seems to work great except with gems that I pull

[Rails] Re: Reusing the model to write a CLI

2011-09-13 Thread maskiran
Hi Thanks a lot. I guess as all of you have suggested my CLI would just be calling the web links directly using curl or wget. I am using such a method now. I thought there might be another way that I could use to write cli, some thing of the form require rails require mydatamodel use the methods

[Rails] Re: q: sessionstore, after_sign_in_path_for , id is nil

2011-09-13 Thread tom
nevermind - solved On Mon, Sep 12, 2011 at 2:21 PM, tom tomabr...@gmail.com wrote: hi, just switched to activerecord sessionstore to add the user_id to the table. during the sign_in view i can see the session_id via %= request.session_options[:id] % then i added as per wiki def

[Rails] Re: Weird Error when Adding ShareThis Hovering Buttons to Rails

2011-09-13 Thread shengloong
soldier.coder, I believe I provided all the information I could in my last email. I admit that I should attach the source code. So here it is at http://pastebin.com/9i4D6zpQ. I put this piece of code (without any other line of code) into two files - one outside my rails app directory and another

Re: [Rails] Re: Weird Error when Adding ShareThis Hovering Buttons to Rails

2011-09-13 Thread Michael Pavling
On 13 September 2011 09:57, shengloong sushenglo...@gmail.com wrote: http://pastebin.com/9i4D6zpQ. I put this piece of code (without any other line of code) into two files - one outside my rails app directory and another one in the public directory. In the end, only the one outside the rails

[Rails] Re: Storing form data in xml file

2011-09-13 Thread maskiran
Thanks, that helped me a lot :-) I don't need the model or the code, all I want is the way to store the data in a file in a directory. How do I keep track of the variables. The reason why I explained in detail: I looked at other posts and got suggestions saying why don't you store the data in the

Re: [Rails] Weird Error when Adding ShareThis Hovering Buttons to Rails

2011-09-13 Thread Colin Law
On 11 September 2011 11:57, shengloong sushenglo...@gmail.com wrote: Hi all, I am trying to add the ShareThis Hovering buttons to my Rails 3 application but have no luck. I got the embed code from http://sharethis.com/publishers/get-hovering-buttons. In order to prove that the problem is

[Rails] foreign key referencing nonprimary key

2011-09-13 Thread Vogon Primo
In a legacy schema sometimes we may discover foreign key constraints that don't follow the simple FK references PK rule, but FK references UNIQUE column rule. Is there a way to mapping this with :foreing_key= ... or some other mechanism with ActiveRecord? -- Posted via

[Rails] need help with session

2011-09-13 Thread tom
hi, im having a hard time to see thru here: after login , i see a different session_id then then one i saw on the login-view. but what throws me off is, that i do store the sessionid in the db here: def after_sign_in_path_for(resource) end section of the application-controller. problem is that

[Rails] Accessing Rails helper method with_output_buffer

2011-09-13 Thread Gogov
Hi all, I cannot figure out how to correctly use the with_output_buffer helper method (located in ActionView::Helpers::CaptureHelper) inside a custom FormBuilder. Below follows a simplified example. I'm trying to achieve the following behavior in an ERB as suggested in the form_for helper docs

[Rails] Re: Accessing Rails helper method with_output_buffer

2011-09-13 Thread Frederick Cheung
On Sep 13, 11:00 am, Gogov mgo...@gmail.com wrote: Hi all, I cannot figure out how to correctly use the with_output_buffer helper method (located in ActionView::Helpers::CaptureHelper) inside a custom FormBuilder. Below follows a simplified example. I'm trying to achieve the following

[Rails] What are ways to embed php wiki engine into Rails app?

2011-09-13 Thread Sub Zero
If there are any. -- 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

[Rails] How to merge routing constraints based on objects?

2011-09-13 Thread Szymon Nowak
Hi, I've got routes similar to this: scope :constraints = Subdomain.new do root :to = something#index, :constraints = Authenticated.new(true) root :to = other#index end The problem is that the constraint in the inner route seems to overwrite the constraint defined for the scope. Is there

[Rails] Re: Ruby Koans

2011-09-13 Thread tonypm
Just started going through - it is nice - thanks for the info! -- 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] Re: How to merge routing constraints based on objects?

2011-09-13 Thread Tim Shaffer
Could you have your Authenticated constrain inherit from the Subdomain constraint and implement its matches? method as well? Something like this maybe? Don't have too much experience with constraints so I'm not sure of the exact syntax, but might be worth playing around. class Authenticated

[Rails] Re: How to merge routing constraints based on objects?

2011-09-13 Thread Szymon Nowak
Thanks, but it doesn't really solve the problem with having to repeat constraints from the outer scope. Additionally, in my case the Authenticated constraint is used in few other places as well, so I'd have to name this particular one e.g. AuthenticatedSubdomain and that will pretty soon

Re: [Rails] What are ways to embed php wiki engine into Rails app?

2011-09-13 Thread Walter Lee Davis
Which Web server are you using? Apache/Passenger? You might be able to get Apache to handle .php files in the Public folder, since Passenger defers anything static (ish) within that folder directly to Apache. So you would see the request at the Apache level, then Apache would send it off

[Rails] session sharing rails3 php

2011-09-13 Thread tom
hi i'm using cookie store and my rails3 runs under passenger. my php script got a own virtual host. cookie domain is .foo.bar. but reading the rails-cookie in php gives me still a completetly different sessionid. can someone shed some light on this? thx -- You received this message because you

Re: [Rails] Re: Storing form data in xml file

2011-09-13 Thread Walter Lee Davis
On Sep 13, 2011, at 5:19 AM, maskiran wrote: Thanks, that helped me a lot :-) I don't need the model or the code, all I want is the way to store the data in a file in a directory. How do I keep track of the variables. The reason why I explained in detail: I looked at other posts and got

[Rails] Re: How to merge routing constraints based on objects?

2011-09-13 Thread Tim Shaffer
After some further testing, this seems a little bazaar. The following code will run both the Subdomain and Authenticated constraints when accessing a resource: scope :constraints = Subdomain.new do resources :something, :constraints = Authenticated.new end However, with the root route

[Rails] Re: How to merge routing constraints based on objects?

2011-09-13 Thread Szymon Nowak
Thanks for the tip! I'll check if there's anything obvious messed up in Rails routing code and just report a bug - we'll see what they say :) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

Re: [Rails] Storing form data in xml file

2011-09-13 Thread Jim Ruther Nill
On Tue, Sep 13, 2011 at 1:53 AM, maskiran maski...@gmail.com wrote: Hi I am writing an application where the form data needs to be stored as xml file. I cannot use data base as I want to provide version management for this data (currently planning on SVN). The form data is a perl script

[Rails] Ruby Midwest 2011 - Give Aways Pricing Changes!

2011-09-13 Thread Luke Pillow
The Ruby Midwest Conference is approaching quickly! Don't miss out on this two day, single track conference scheduled for Friday and Saturday, November 4-5, 2011 in downtown Kansas City, MO with keynotes from Uncle Bob Martin and Andy Hunt. - General Admission is $189 until October 1, 2011 -

[Rails] Re: What are ways to embed php wiki engine into Rails app?

2011-09-13 Thread Robert Walker
Walter Davis wrote in post #1021691: Which Web server are you using? Apache/Passenger? You might be able to get Apache to handle .php files in the Public folder, since Passenger defers anything static (ish) within that folder directly to Apache. So you would see the request at the Apache

[Rails] Re: What are ways to embed php wiki engine into Rails app?

2011-09-13 Thread Alexey Petrushin
iframe ? :) -- 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

Re: [Rails] check_box not passing 0 when unchecked?

2011-09-13 Thread Chris Mear
On 12 Sep 2011, at 20:11, Michael Pavling wrote: I've been wracking my brains to see what's wrong with the HTML (especially since it's been generated with the check_box() helper). Maybe I'm missing something obvious... ? I don't think you're missing anything -- I've tested Joan's code in

[Rails] Re: check_box not passing 0 when unchecked?

2011-09-13 Thread Joan Gu
Thank you all for the help. Yes, the test was done in firefox 6.0.2 and the params were passed through an ajax link by checking checkbox value (jquery). Can't paste the code here coz I can't access the source now. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Dynamic css files using scss

2011-09-13 Thread Rafa Colom
I'm trying change the value of a scss variable dynamically using rails 3.1. For example: In a example.css.scss $main-color: red; body { background-color: $main-color; color: #333; font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; } And in the

[Rails] Refactoring controllers with multiple functions per action

2011-09-13 Thread Hans
I have controllers with multiple fucntions per action depending on that they are called from different forms and views. For example a controller shows a place on a map, but depending on if the place is selected from a meny or from an autocomplete field or from some associated model that belongs to

[Rails] Questions on scopes

2011-09-13 Thread Jesse
Hey Group, I am trying to use [what I thought should be] a simple scope for a message object scope :unread, where(:read_at = nil) where the read_at attribute is of type datetime This is causing the scope to trip a no method error when called upon. I have a helper method which contains :

Re: [Rails] Refactoring controllers with multiple functions per action

2011-09-13 Thread Colin Law
On 13 September 2011 15:58, Hans hans.marmo...@klockholm.se wrote: I have controllers with multiple fucntions per action depending on that they are called from different forms and views. For example a controller shows a place on a map, but depending on if the place is selected from a meny or

[Rails] how to use google charts in ruby on rails

2011-09-13 Thread honey ruby
hey everyone i wanna use google charts in ruby on rails. can any one tell how to use . wht are the plug-in or gems needed . its urgent guys . 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

[Rails] q: cookies, expire

2011-09-13 Thread tom
hi as far as i know, if u want to have a cookie expired on a browser close, u set the expire object to zero. if this is correct, where would i do that in rails3? and which code would that be? cookies.signed[:login] = {:value = @user.id, :expires = Time.now} request.session_options[:expire_after]

[Rails] Changing adapters in ActiveRecord does not change the generated sql

2011-09-13 Thread Bradley
If I establish a new connection with a new adapter (ie. switch from mysql to postgresl) the generated sql is still mysql specific. I tried all sorts of reset methods on AR::Base but to no avail. There must be something being memoized on ActiveRecord base that has to do with the adapter and it

Re: [Rails] Talented Junior Ruby Developer Wanted!

2011-09-13 Thread vishal singh
Hello, My name is vishal singh.I am B-Tech graduate 2011 passout.I have 7 month exp in Ruby On Rails .Currently i am working in CMIsoft ghaziabad. Regards, Vishal Singh -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

Re: [Rails] Talented Junior Ruby Developer Wanted!

2011-09-13 Thread Amrit Pal Pathak
On Tue, Sep 13, 2011 at 11:37 AM, vishal singh vishal.singh...@gmail.comwrote: Hello, My name is vishal singh.I am B-Tech graduate 2011 passout.I have 7 month exp in Ruby On Rails .Currently i am working in CMIsoft ghaziabad. What is purpose of this mail?What is your question?

[Rails] Heroku failed to push: fatal: sha1 file 'stdout' write error: Invalid argument

2011-09-13 Thread Àsgeir G.
When I try to push my app to Heroku I get this error: OCA@OCA-PC /c/rails/oca (master) $ git push heroku master Enter passphrase for key '/c/Users/OCA/.ssh/id_rsa': Counting objects: 913, done. Delta compression using up to 2 threads. Compressing objects: 100% (797/797), done. Read from remote

[Rails] Re: Questions on scopes

2011-09-13 Thread Frederick Cheung
On Sep 13, 4:16 pm, Jesse draco...@gmail.com wrote: Hey Group, I am trying to use [what I thought should be] a simple scope for a message object    scope :unread, where(:read_at = nil) where the read_at attribute is of type datetime This is causing the scope to trip a no method error

[Rails] Re: Changing adapters in ActiveRecord does not change the generated sql

2011-09-13 Thread Frederick Cheung
On Sep 13, 4:29 pm, Bradley bradleyrobert...@gmail.com wrote: Does anyone know how to fully clear out whatever it is that is caching this sql being generated??   I searched through the source and was able to unset @quoted_table_name on the user model, this regenerated the table name

[Rails] ruby on rails installation problem

2011-09-13 Thread Sai Ch
i have problem with installation of ruby on rails in my windows xp operating system please help what are the step to be followed and how to install ruby gems -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

Re: [Rails] Re: Questions on scopes

2011-09-13 Thread Jesse
On 9/13/11 12:39 PM, Frederick Cheung wrote: On Sep 13, 4:16 pm, Jessedraco...@gmail.com wrote: Hey Group, I am trying to use [what I thought should be] a simple scope for a message object scope :unread, where(:read_at = nil) where the read_at attribute is of type datetime This is

Re: [Rails] ruby on rails installation problem

2011-09-13 Thread jason white
use the rails installer for windows, this will get you up and running. http://www.railsinstaller.org/ On Tue, Sep 13, 2011 at 8:22 AM, Sai Ch chsai.bt...@gmail.com wrote: i have problem with installation of ruby on rails in my windows xp operating system please help what are the step to be

[Rails] help me, I can't run

2011-09-13 Thread Lee
Hi, I installed railsinstaller. and ... rails s TCPServer Error: Permission denied - bind(2) Exiting C:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/webrick/utils.rb:73:in 'initailize':permission denied - bind(2) (Errno::EACCES) from

[Rails] need clarification on session

2011-09-13 Thread tom
hi running a working rails3 + devise app. once i sign in, i store the session id in the db. then when i go back to the index view, the id is different. how can that be? im always using: controller request.session_options[:id] view: %= logger.info session.inspect % hr %=

[Rails] splitted class into separate table activerecord

2011-09-13 Thread Vogon Primo
Suppose that in legacy schema,that you are working on getting ActiveRecord to work with, you aren't keeping all the information about user, with the user's main information in the users table, but in a separate table. For example: table users user_id firstname lastname table auth_info

[Rails] Re: need clarification on session

2011-09-13 Thread Frederick Cheung
On Sep 13, 5:58 pm, tom tomabr...@gmail.com wrote: hi running a working rails3 + devise app. once i sign in, i store the session id in the db. then when i go back to the index view, the id is different. how can that be? im always using: What session store are you using? If you are using

[Rails] Re: Questions on scopes

2011-09-13 Thread Frederick Cheung
On Sep 13, 5:51 pm, Jesse draco...@gmail.com wrote: On 9/13/11 12:39 PM, Frederick Cheung wrote: When comparing with nil you have to use IS NULL rather than the usual comparison operator. where(:read_at =  nil) should work though. How are you using the scope? I am making a call to it

Re: [Rails] Re: need clarification on session

2011-09-13 Thread tom
hi frederick yes im using cookistore.mayb i've expressed myself wrong. lets say im on my landing page, refresh and print out the sessiond: cd97142191ba68518a5f36d15d63299d then i do a login plus store the session immedialty into the db and get redirected to the indexview which now shows:

[Rails] Re: Heroku failed to push: fatal: sha1 file 'stdout' write error: Invalid argument

2011-09-13 Thread Àsgeir G.
Problem solved max app size is 100 MB for heroku: http://devcenter.heroku.com/articles/slug-szie -- 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

Re: [Rails] help me, I can't run

2011-09-13 Thread Noel
have u tried the latest railsinstaller? On Tue, Sep 13, 2011 at 4:27 AM, Lee sorlo...@gmail.com wrote: Hi, I installed railsinstaller. and ... rails s TCPServer Error: Permission denied - bind(2) Exiting C:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/webrick/utils.rb:73:in

[Rails] Re: help me, I can't run

2011-09-13 Thread Luis Lavena
On Sep 13, 8:27 am, Lee sorlo...@gmail.com wrote: Hi, I installed railsinstaller. and ... rails s TCPServer Error: Permission denied - bind(2) Exiting C:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/webrick/utils.rb:73:in 'initailize':permission denied - bind(2) (Errno::EACCES)         from

Re: [Rails] Re: need clarification on session

2011-09-13 Thread tom
crap, i copied the wrong one: the sessionvalue in teh db is the one from prior the login im doing the db-store in the after_signed_in hook of devise thx On Tue, Sep 13, 2011 at 1:08 PM, tom tomabr...@gmail.com wrote: hi frederick yes im using cookistore.mayb i've expressed myself wrong. lets

Re: [Rails] Dynamic css files using scss

2011-09-13 Thread steve ross
This is a heck of a lot easier to do in the presentation than the style. Consider this: body .red background-color: red .green background-color: green body class=%= @theme_main_color % Stuff inside /div In your controller (or application controller), simply set @theme_main_color

Re: [Rails] Re: Questions on scopes

2011-09-13 Thread Jesse
On 9/13/11 1:04 PM, Frederick Cheung wrote: On Sep 13, 5:51 pm, Jessedraco...@gmail.com wrote: On 9/13/11 12:39 PM, Frederick Cheung wrote: When comparing with nil you have to use IS NULL rather than the usual comparison operator. where(:read_at =nil) should work though. How are you using

[Rails] carmen issue

2011-09-13 Thread Abhishek shukla
Hello I am facing some wired error with carmen ActionView::Template::Error (undefined method `collect' for US:String): %= f.country_select(:country, US) % Please if someone can help that will be great. Thanks Abhis -- You received this message because you are subscribed to the Google Groups

Re: [Rails] how to use google charts in ruby on rails

2011-09-13 Thread Greg Reinacker
Well, assuming you're talking about the newer google visualization API, you don't really need to use any gems at all - it's just javascript. That said, I use this to help: https://github.com/winston/google_visualr/ -GR On Sep 13, 2011, at 9:25 AM, honey ruby wrote: hey everyone i wanna use

[Rails] model association question

2011-09-13 Thread Randy Regnier
I have a question about how best to model a pair of properties/attributes in Rails3. The generic models are: class Foo ActiveRecord::Base end class Bar ActiveRecord::Base end I want Foo to have two associations with Bar, along the lines of 'has_one' for each association, where I can work

Re: [Rails] model association question

2011-09-13 Thread Jesse
On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic models are: class Foo ActiveRecord::Base end class Bar ActiveRecord::Base end I want Foo to have two associations with Bar, along the lines of 'has_one'

Re: [Rails] Talented Junior Ruby Developer Wanted!

2011-09-13 Thread Dave Aronson
Amrit Pal Pathak amritpalpath...@gmail.com wrote: vishal singh vishal.singh...@gmail.com wrote: ...    My name is vishal singh.I am B-Tech graduate 2011 passout.I have 7 month exp in Ruby On Rails .Currently i am working in CMIsoft ghaziabad. What is purpose of this mail?What is your

Re: [Rails] model association question

2011-09-13 Thread Randy Regnier
On 09/13/2011 03:34 PM, Jesse wrote: On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic models are: class Foo ActiveRecord::Base end class Bar ActiveRecord::Base end I want Foo to have two associations

Re: [Rails] model association question

2011-09-13 Thread Colin Law
On 13 September 2011 22:17, Randy Regnier rbregn...@gmail.com wrote: On 09/13/2011 03:34 PM, Jesse wrote: On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic models are: class Foo ActiveRecord::Base end

[Rails] Re: Weird assignment problem, very confused :(

2011-09-13 Thread Alex Krivoshchekov
Alexey Muranov wrote in post #1019202: 7stud -- wrote in post #1019196: What version are you guys using? Also what version of ruby, rails and sqlite? $ rails -v Rails 3.1.0.rc8 $ ruby -v ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0] $ sqlite3 -version 3.7.7.1

Re: [Rails] model association question

2011-09-13 Thread Randy Regnier
On 09/13/2011 04:21 PM, Colin Law wrote: On 13 September 2011 22:17, Randy Regnierrbregn...@gmail.com wrote: On 09/13/2011 03:34 PM, Jesse wrote: On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic models

Re: [Rails] model association question

2011-09-13 Thread Jesse
On 9/13/11 5:17 PM, Randy Regnier wrote: On 09/13/2011 03:34 PM, Jesse wrote: On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic models are: class Foo ActiveRecord::Base end class Bar ActiveRecord::Base

[Rails] how can I get the stack trace for a 500 error to show up in test.log?

2011-09-13 Thread Stephen Bannasch
I'm driving a rails 3.0.10 app with capaybara/seleinium and when I get a 500 error I can't get the stack trace to appear in log/test.log All I see is the following: Rendered resource_pages/show.html.haml within layouts/application (15.2ms) Completed 500 Internal Server Error in 250ms When

[Rails] Re: check_box not passing 0 when unchecked?

2011-09-13 Thread Joan Gu
Frederick Cheung wrote in post #1021765: Ah, ajax may be the key. How are you serialising the form inputs? If you're always submitting the checkbox's value then it will indeed only ever submit '1'. You'd need to select the appropriate value based on whether the checkbox was checked. Fred Hi