Re: [Rails] Re: Multiple table inheritance

2011-11-07 Thread Colin Law
On 6 November 2011 22:48, Philippe M. li...@ruby-forum.com wrote: Hi scott Thanks for ur answer As you guess i'm a newbie in Rails I agree with your answer. But technically i still need to find my way. I believe Scott is suggesting that you just have one class, User or Person or Company or

Re: [Rails] Re: Multiple table inheritance

2011-11-07 Thread Michael Pavling
On 7 November 2011 08:51, Colin Law clan...@googlemail.com wrote: On 6 November 2011 22:48, Philippe M. li...@ruby-forum.com wrote: I agree with your answer. But technically i still need to find my way. I believe Scott is suggesting that you just have one class, User or Person or Company or

[Rails] Re: How to convert Csv into Excel

2011-11-07 Thread qwan
Hi I have written a toolkit in this area, still working toward releasing the gem on ruby gems but project/source is here https://github.com/autotelik/interact The .xls file read/write requires JRuby but is OS independant and does not require Excel be installed. The main focus is import/export

[Rails] Mess and gems and Rails

2011-11-07 Thread Leo M.
I know, the title is quite confusing, as much as I am. The thing is : there must be something that slips aways from my understanding, because every now and again I have to reinstall all the gems, even though I already have them installed. It happens sometimes that I'm executing a rails console

Re: [Rails] How to convert Csv into Excel

2011-11-07 Thread Colin Law
On 7 November 2011 04:50, Sasi ssasidara...@gmail.com wrote: Is there any ruby gems or plugin which can be used for converting (.csv) files inot (.xls) files , or is there any mechanism which can be used for the conversion of files from csv to xls . The spreadsheet gem may help. Colin --

Re: [Rails] Re: How to convert Csv into Excel

2011-11-07 Thread Michael Pavling
On 7 November 2011 09:27, qwan goo...@autotelik.co.uk wrote: I have written a toolkit in this area, still working toward releasing the gem on ruby gems but project/source is here https://github.com/autotelik/interact http://xkcd.com/974/ I tend to just open the CSV in Excel... :-/ -- You

[Rails] Re: Initialising error on Ubuntu 11.10 - rubygems installation and policy

2011-11-07 Thread Colin Law
On 7 November 2011 09:28, Tommy Pollak tpol...@algonet.se wrote: Sorry, but I can not remember how I installed rubygems. I certainly tried with the Ubuntu (10.10) packages first. $ apt-cache policy rubygems rubygems:  Installed: 1.7.2-1  Candidate: 1.7.2-1 So you installed it from the

[Rails] Re: Sublime Text Editor

2011-11-07 Thread Xuan
I tried it and I only miss autoformat the way netbeans or rubymine implement it (ctrl+alt+f). Does it have such functionality and I missed it or is there a plan to add it? On 6 nov, 21:51, MarcRic marc...@gmail.com wrote: Finally, a decent TextMate like Multi-platform (including Windows)

Re: [Rails] Re: How to convert Csv into Excel

2011-11-07 Thread Colin Law
On 7 November 2011 09:27, qwan goo...@autotelik.co.uk wrote: Hi I have written a toolkit in this area, still working toward releasing the gem on ruby gems but project/source is here https://github.com/autotelik/interact Are you planning to support ods files? That is something I am sorely

[Rails] Re: no such file to load -- openssl (LoadError) - Deperate for solution after 3 days

2011-11-07 Thread shireesh
hope you have updated rvm to latest version (rvm update) before installing ruby 1.9.3. regards shireesh On Nov 6, 7:40 pm, Rob on the Rails r...@entelecheia.com wrote: no such file to load -- openssl (LoadError)  - Deperate for solution after 3 days Does anybody have an answer, or ever some

[Rails] access requesting IP from actionwebservice controller/model

2011-11-07 Thread Daniel Buchan
I'm building a SOAP server for a rails project we have here. I'm using actionwebservice to achieve this. Inside the logic for one of the SOAP methods I need to read the IP address of the requesting client. For a regular rails controller we've been using this construct, which works nicely

[Rails] connect': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (Mysql2

2011-11-07 Thread dv dhanadan
Hi all, I did a fresh install of ROR on my fedora 15,i get the following error. $ rails s = Booting WEBrick = Rails 3.1.1 application starting in development on http://0.0.0.0:3000 = Call with -d to detach = Ctrl-C to shutdown server Exiting

Re: [Rails] connect': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (Mysql2

2011-11-07 Thread murali dhararao
Can you give me your database.yml configurations? On Mon, Nov 7, 2011 at 5:01 PM, dv dhanadan li...@ruby-forum.com wrote: Hi all, I did a fresh install of ROR on my fedora 15,i get the following error. $ rails s = Booting WEBrick = Rails 3.1.1 application starting in development on

[Rails] Re: HOWTO: install Ruby on Rails for Ubuntu and Fedora and Sqlite3 or MySQL

2011-11-07 Thread dv dhanadan
Manuele Dones wrote in post #1005988: If you have some issues to install ror on ubuntu or fedora, my tutorials could help you: ROR and Sqlite3 for Ubuntu 11.04http://cicolin.blogspot.com/2010/10/how-to-install-ruby-rails-and.html ROR and mysql with Ubuntu

[Rails] has_and_belongs_to_many or has_many :through?

2011-11-07 Thread Mauro
I always has doubts on using has_and_belongs_to_many rather than has_many :through association. I have a model like this: class Company ActiveRecord::Base has_many :categories has_many :legal_representatives has_many :tenders has_many :documents end I don't see any way to use another

[Rails] Re: no such file to load -- openssl (LoadError) - Deperate for solution after 3 days

2011-11-07 Thread Frederick Cheung
On Nov 6, 10:49 pm, Rob on the Rails r...@entelecheia.com wrote: Leonardo, I did the re-install as below, then searched the build log as suggested (also below). Mine looks almost identical to yours, unless I am missing something. But the results are the same. I am really stumped.

Re: [Rails] has_and_belongs_to_many or has_many :through?

2011-11-07 Thread Colin Law
On 7 November 2011 12:15, Mauro mrsan...@gmail.com wrote: I always has doubts on using has_and_belongs_to_many rather than has_many :through association. I have a model like this: class Company ActiveRecord::Base  has_many :categories  has_many :legal_representatives  has_many :tenders  

Re: [Rails] Re: functional testing API: GET versus POST?

2011-11-07 Thread Rob Biedenharn
On Nov 6, 2011, at 4:35 PM, Grary Stimon wrote: request = 4_000_000 post :loan, {:loan_request=request, :format = :json} ...finally the test log of the request is... Processing by Sec223fAcquisitionController#loan as JSON The influence of the :format=:json bit is ...^^here^^. If

[Rails] I18n on model attributes

2011-11-07 Thread Rodrigo Ruiz
Hi, I have to set those language flags on my website, and depending on which one was selected it should show the pages in specific languages. Problem is that this translation is also needed for the model attributes. How should I do that? Just save many attributes (one for each language) for each

Re: [Rails] Mess and gems and Rails

2011-11-07 Thread Walter Lee Davis
On Nov 7, 2011, at 4:31 AM, Leo M. wrote: I know, the title is quite confusing, as much as I am. The thing is : there must be something that slips aways from my understanding, because every now and again I have to reinstall all the gems, even though I already have them installed. It

[Rails] Re: add dynamic nested attributes without nested form gem

2011-11-07 Thread Angelo Cordova
Ok, I've followed this cast http://railscasts.com/episodes/197-nested-model-form-part-2 but I get an error when I try to add the link to add fields (remove works as expected) this is the error NoMethodError in Projects#new Showing /home/angelo/nestattr/app/views/projects/_form.html.erb

[Rails] Typus save/edit form

2011-11-07 Thread JavierQQ
Hi, I have some troubles with Typus form when I want to Save and add new and I want to know if there's anyone here that uses Typus. What I want to know is how can I clean the fields of the form after hitting Save and add new I have a question_controller and inside I put this def new

Re: [Rails] has_and_belongs_to_many or has_many :through?

2011-11-07 Thread Mauro
On 7 November 2011 13:43, Colin Law clan...@googlemail.com wrote: On 7 November 2011 12:15, Mauro mrsan...@gmail.com wrote: I always has doubts on using has_and_belongs_to_many rather than has_many :through association. I have a model like this: class Company ActiveRecord::Base  has_many

Re: [Rails] has_and_belongs_to_many or has_many :through?

2011-11-07 Thread Walter Lee Davis
On Nov 7, 2011, at 1:26 PM, Mauro wrote: On 7 November 2011 13:43, Colin Law clan...@googlemail.com wrote: On 7 November 2011 12:15, Mauro mrsan...@gmail.com wrote: I always has doubts on using has_and_belongs_to_many rather than has_many :through association. I have a model like this:

Re: [Rails] has_and_belongs_to_many or has_many :through?

2011-11-07 Thread Dave Aronson
On Mon, Nov 7, 2011 at 13:26, Mauro mrsan...@gmail.com wrote: For example: I have a Company with many legal_representatives and a LegaRepresentative that has many companies. In this case you use a has_and_belongs_to_many or has_many :through? What's reasoning that leads me to select

Re: [Rails] has_and_belongs_to_many or has_many :through?

2011-11-07 Thread Mauro
On 7 November 2011 19:32, Dave Aronson googlegroups2d...@davearonson.com wrote: So, aside from declaring one more class, there's no reason not to use hmt from the start. Ok, that's good, if I need or not to attach information to the relationship I can always use has_many :through. Can you

Re: [Rails] Mess and gems and Rails

2011-11-07 Thread Dave Aronson
On Mon, Nov 7, 2011 at 09:11, Walter Lee Davis wa...@wdstudio.com wrote: If you're using RVM, it's a matter of setting an .rvmrc file with the correct ruby to use, or calling rvm use 1.9.2 (or whatever) before you start using Rails. I found it easiest to call rvm, with my usual Ruby, in

Re: [Rails] has_and_belongs_to_many or has_many :through?

2011-11-07 Thread Dave Aronson
On Mon, Nov 7, 2011 at 13:53, Mauro mrsan...@gmail.com wrote: Can you suggest a name for the :through model between Company and LegalRepresentative? Off the top of my head, maybe LegalRepresentation? Or since it's so close to an existing class, maybe just Representation? (Unless the Company

[Rails] Problem with Rails3.1.1 in mass_assignment_authorizer

2011-11-07 Thread byrnejb
By accident I had Rails-3.1.1 installed by bundler. However, when I discovered this mishap during my feature run I encountered this error in many places: wrong number of arguments (1 for 0) (ArgumentError) /home/byrnejb/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.1.1/

[Rails] RSpec fails although it shouldn't

2011-11-07 Thread Gregor Panek
Hi all, i wrote a Rspec test for my controller and it fails although it should pass. Here is my Rspec test: require 'spec_helper' describe UsersController do render_views describe GET 'show' do it returns http success do get 'show'

Re: [Rails] RSpec fails although it shouldn't

2011-11-07 Thread Dave Aronson
On Mon, Nov 7, 2011 at 15:49, Gregor Panek symf...@gregorpanek.de wrote:        describe GET 'show' do                it returns http success do                        get 'show'                        response.should be_success                end Don't you need to specify an id there? Or

Re: [Rails] RSpec fails although it shouldn't

2011-11-07 Thread Gregor Panek
Am 07.11.2011 um 21:58 schrieb Dave Aronson: On Mon, Nov 7, 2011 at 15:49, Gregor Panek symf...@gregorpanek.de wrote: describe GET 'show' do it returns http success do get 'show' response.should be_success

Re: [Rails] RSpec fails although it shouldn't

2011-11-07 Thread Dave Aronson
On Mon, Nov 7, 2011 at 16:11, Gregor Panek symf...@gregorpanek.de wrote: Am 07.11.2011 um 21:58 schrieb Dave Aronson: Don't you need to specify an id there? How to do that? I just started to learn how write tests for the application. I recommend you read:

[Rails] Re: Problem with Rails3.1.1 in mass_assignment_authorizer

2011-11-07 Thread byrnejb
I found my problem is a library I wrote to turn off mass assignment . In it I am calling this: # override AR method def mass_assignment_authorizer if accessible == :all self.class.protected_attributes else super + ( accessible || [] ) end end

[Rails] undefined method `seed'

2011-11-07 Thread slava
hello, I am trying to deploy a rails 3.1 app to Heroku and need to run db:seed My seeds file has this code User.seed do |s| s.email = t...@temp.com s.password = bigsecret s.password_confirmation = bigsecret end Running rake db:seed locally works fine, but after deployment to Heroku I try

[Rails] Rails-3.1.1 Deprecation warnings:

2011-11-07 Thread byrnejb
When I run cucumber I now see these messages: DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2. (called from require at /home/byrnejb/.rvm/gems/ruby-1.8.7- p352@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68) DEPRECATION WARNING: new is deprecated and will be

Re: [Rails] RSpec fails although it shouldn't

2011-11-07 Thread Gregor Panek
Am 07.11.2011 um 22:22 schrieb Dave Aronson: On Mon, Nov 7, 2011 at 16:11, Gregor Panek symf...@gregorpanek.de wrote: Am 07.11.2011 um 21:58 schrieb Dave Aronson: Don't you need to specify an id there? How to do that? I just started to learn how write tests for the application. I

Re: [Rails] Rails 3.0.7 - validates uniqueness, factory girl, and transactions with rspec

2011-11-07 Thread Max Schubert
Turned out that an earlier mail thread you had responded on, Dave, had the answer - I hadn't looked into the model code deeply enough till today to realize our uniqueness constraints were missing :scope conditions to constrain them properly! - Max -- You received this message because you are

Re: [Rails] Adding a site admin user while creating a site

2011-11-07 Thread newrails user
HI Gurus, I could achieve this, I wanted to updated a filed in user table without taking input from user as asked before.I wanted to set a role to user without taking input from user.So in registration_controller action of (devise) I have set resource.role='siteadmin'.But its not taking that it

[Rails] why is my text_field getting a default value of current_user.email?

2011-11-07 Thread Fearless Fool
I have a form containing a text field along the lines of: %= form_for(wizard, :url = wizard_path, :method = :put) do |f| % %= form.text_field gas_credentials[user_id], :value = wizard.gas_credentials['user_id'] % % end % Mysteriously, when wizard.gas_credentials is nil, the

Re: [Rails] Adding a site admin user while creating a site

2011-11-07 Thread newrails user
So This is what it is happennig, the role assign works well if i create user normally from its own view, But if I create the user form the site creation view. the role assignment statement (resource.role=siteadmin) doesnt work. This code exisits in the user controller. Any inputs would be

[Rails] Re: why is my text_field getting a default value of current_user.email?

2011-11-07 Thread Fearless Fool
Doh! The answer: browser autocompletion. I'm leaving this post in place rather than deleting it out of shame in the faint hope that it might save someone else a few minutes of head scratching. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed

[Rails] Re: why is my text_field getting a default value of current_user.email?

2011-11-07 Thread Fearless Fool
[silly forum code won't let me edit previous reply.] To prevent autocompletion, you can do something like: %= form.text_field gas_credentials[user_id], :value = wizard.gas_credentials['user_id'], :autocomplete = :off % -- Posted via http://www.ruby-forum.com/.

[Rails] Re: rubygems Problem on ubuntu 10.04

2011-11-07 Thread MaT 2.
i hope somebody can help me with this kind of problem.. -- 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

Re: [Rails] Re: why is my text_field getting a default value of current_user.email?

2011-11-07 Thread Michael Pavling
On 8 November 2011 00:50, Fearless Fool li...@ruby-forum.com wrote: [silly forum code won't let me edit previous reply.] That's because it's a mailing list... and even if every other subscriber let you come around to their house and edit their emails, I wouldn't ;-) The ruby-forum is just a