[Rails] Re: What is this error?

2012-03-23 Thread Ruby User
Hi Alex, changing it to require 'action_pack' worked. But other gems has the same issue - # ./test.rb /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler (LoadError) from /usr/local/rvm/rubies/ruby-1

Re: [Rails] difference between merging a hash in ruby and using merge_conditions of activerecord

2012-03-23 Thread Colin Law
On 23 March 2012 21:48, John Merlino wrote: > The ruby library comes with a method called merge that allows you to > merge two hashes. So then why does merge_conditions exist in > activereocrd, which appears to be doing the same thing. I don't think merge_conditions /does/ exist any more (in Rail

[Rails] difference between merging a hash in ruby and using merge_conditions of activerecord

2012-03-23 Thread John Merlino
The ruby library comes with a method called merge that allows you to merge two hashes. So then why does merge_conditions exist in activereocrd, which appears to be doing the same thing. thanks for response -- You received this message because you are subscribed to the Google Groups "Ruby on Rai

[Rails] Re: What is this error?

2012-03-23 Thread Ruby User
Yes. actionpack is installed. # gem list -d actionpack /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/yaml.rb:56:in `': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. *** LOCAL GEMS *** acti

[Rails] Re: @model OR :model in a form_for

2012-03-23 Thread Cluter Vipic
Hi, I figured out this error undefined method `basket' for # simply add two columns (apple & basket) in the table called Table :) now appear correctly the webpage with the drop down menu so If you have in the app/views/table/new.html.erb 1. <%= form_for @table do |f| %> 2. <%= f.collection_s

[Rails] Net::IMAP throws .[] for nil class on search

2012-03-23 Thread Kirill Bezrukov
>> require 'net/imap' >> imap = Net::IMAP.new('imap.yandex.ru', 993, true) >> imap.login('login', 'password') >> imap.select('INBOX') => #, text=" SELECT completed">, raw_data="RUBY0010 OK [READ-WRITE] SELECT completed\r\n"> >> imap.search(['ALL']) NoMethodError: You have a nil object when you did

Re: [Rails] gsub

2012-03-23 Thread 欧阳东晖
Does *system('i_view32.exe', 'C:\\Rails\\test.png', '/convert=C:\\Rails\\test.jpg')* work for you? On Fri, Mar 23, 2012 at 8:49 PM, Aaron Schmitz wrote: > thank younever thought about that.. > next question! :D > when i put in mit shell : i_view32.exe C:\Rails\test.png > /convert=C:\Rails\tes

[Rails] Facebook Connect SSL Issue

2012-03-23 Thread Julius
Hello =), I've been trying to connect facebook using OmniAuth (https:// github.com/ intridea/omniauth), through i'm getting a SSL Error message: OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed I was checking posts like this o

Re: [Rails] CanCan is leaving numbers in my views

2012-03-23 Thread Raul Sanchez
Hi Yo should write as this: @clubs.each do |club| %tr %td= club.name %td= link_to 'Show', club - if can? :update, club %td= link_to 'Edit', edit_club_path(club) - if can? :destroy, club %td= link_to 'Destroy', club, :confirm => 'Are you sure?', :method => :de

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

2012-03-23 Thread Colin Law
On 23 March 2012 16:48, bingo bob wrote: > Colin Law wrote in post #1052938: >> On 23 March 2012 09:24, bingo bob wrote: >>> "owned" by different users who may have it as a different position in >>> Freddy >>> Rod (3, male) >> A couple of questions >> Are all the Rod records identical except for

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

2012-03-23 Thread Colin Law
On 23 March 2012 16:48, bingo bob wrote: > Colin Law wrote in post #1052938: >> On 23 March 2012 09:24, bingo bob wrote: >>> "owned" by different users who may have it as a different position in >>> Freddy >>> Rod (3, male) >> A couple of questions >> Are all the Rod records identical except for

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

2012-03-23 Thread bingo bob
Colin Law wrote in post #1052938: > On 23 March 2012 09:24, bingo bob wrote: >> "owned" by different users who may have it as a different position in >> Freddy >> Rod (3, male) > A couple of questions > Are all the Rod records identical except for which user they belong to? No they're not - for e

[Rails] How to update a model object “the Rails way?”

2012-03-23 Thread David M
I have two models: User and Profile. User has_one Profile, and Profile belongs_to User. How to update a Profile? I have done it this way: def update @user = User.find(session[:member_id]) @profile = @user.profile updated = @profile.update_attributes(params[:profile]) if updated f

[Rails] How to embed CSS3 fonts in Rails 3.0.9

2012-03-23 Thread Tsegaselassie Tadesse
I'm using Rails 3.0.9, and I want to use @font-face CSS3 feature to embed fonts in my app. Here's my CSS. @font-face { > font-family: 'CodeBoldRegular'; > src: url('code_bold-webfont.eot'); > src: url('code_bold-webfont.eot?#iefix') format('embedded-opentype'), > url('code_bo

[Rails] Re: CanCan is leaving numbers in my views

2012-03-23 Thread scott
On Friday, March 23, 2012 5:50:09 AM UTC-4, Frederick Cheung wrote: > > > > > = if can? :update, club > > %td= link_to 'Edit', edit_club_path(club) > > You should be using > > - if can? :update, club > > Using = tells haml that you want the result of the if expression (ie > the va

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 13:46, Aaron Schmitz wrote: > is it a permission issue on win xp? > the command is ok, i tested it in cmd.exe Probably... I recommend a nice Linux install (even just a VM... ;-) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

Re: [Rails] gsub

2012-03-23 Thread Aaron Schmitz
"=> nil" i can start "calc.exe" from firefox via the controller that says "* system("calc.exe")*". but i cannot start i_view32.exe or firefox.exe etc. is it a permission issue on win xp? the command is ok, i tested it in cmd.exe -- You received this message because you are subscribed to the Goog

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 12:49, Aaron Schmitz wrote: > next question! :D > system("i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg") > doesn't work. What happens when you try: system("i_view32.exe C:\\Rails\\test.png /convert=C:\\Rails\\test.jpg") ? -- You received this message because you

Re: [Rails] foreign_key definition apparently not recognized

2012-03-23 Thread Colin Law
On 22 March 2012 20:34, bwb wrote: > These models are defined with respect to a legacy database: > > class VeType < ActiveRecord::Base >        has_many :ve                         #plural defined as "ve" >        self.primary_key = "typeID" I don't know whether it amounts to the same thing but i

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

2012-03-23 Thread Colin Law
On 23 March 2012 09:24, bingo bob wrote: > OK > > Thanks - I've had another think about it but I'd still appreciate any > insight if possible. I had wondered if my data model is wrong but I > don't think so, it's rather simple. > > Users have names and Names belong to users. It has to be like this

Re: [Rails] gsub

2012-03-23 Thread Aaron Schmitz
thank younever thought about that.. next question! :D when i put in mit shell : i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg it works. but when i do *system("i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg")* it doesn't work. what am i doing wrong?i guess it is escaping

[Rails] Re: What is this error?

2012-03-23 Thread Alex Mercer
1. You sure that actionpack is installed? 2. Instead of require 'actionpack' use: require 'action_pack' On Friday, March 23, 2012 5:17:10 AM UTC+2, Ruby-Forum.com User wrote: > > Hi Alex, thanks a lot for some informative advice. > I tried those things. Still no luck :/ > > # env | grep

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 10:36, Aaron Schmitz wrote: > hi, > > im getting tired on this one. > i want to replace all forwardslashes with backwardslashes. > > irb: > r = "C:/RAILS/" > r.gsub("/", "\\") or r.gsub("/") {('\'} both give me: > "C:\\RAILS\\" > > how can i use gsub to display only one "\"? It's

[Rails] gsub

2012-03-23 Thread Aaron Schmitz
hi, im getting tired on this one. i want to replace all forwardslashes with backwardslashes. irb: r = "C:/RAILS/" r.gsub("/", "\\") or r.gsub("/") {('\'} both give me: "C:\\RAILS\\" how can i use gsub to display only one "\"? regards -- You received this message because you are subscribed to

[Rails] Re: CanCan is leaving numbers in my views

2012-03-23 Thread Frederick Cheung
>     = if can? :update, club >       %td= link_to 'Edit', edit_club_path(club) You should be using - if can? :update, club Using = tells haml that you want the result of the if expression (ie the value that "can? :update, club") to be output in the view. Fred -- You received this message b

[Rails] deploy rails3 application on windows server 2011

2012-03-23 Thread Daisy Di
Dear All, I want to deploy the rails3 app on the windows server, but i searched a lot and also test a lot, all failed. could anyone show me the details of the setting? Thanks. Daisy -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] foreign_key definition apparently not recognized

2012-03-23 Thread bwb
These models are defined with respect to a legacy database: class VeType < ActiveRecord::Base has_many :ve #plural defined as "ve" self.primary_key = "typeID" end class Ve < ActiveRecord::Base belongs_to :ve_type, :foreign_key => "TypeID"

[Rails] ActiveRecord and sequences, a bit of a twist.

2012-03-23 Thread David Kerr
Howdy, I'm very new with Ruby and ActiveRecord. I've got a table in postgres that looks something like create table test test_id not null default nextval('test_id_seq') test_parent int not null test_name varchar(20) not null For the parent record: test_parent = tes

[Rails] CanCan is leaving numbers in my views

2012-03-23 Thread scott
I have a rail app setup with devise and i am now adding cancan. The problem i am having is that where ever i have can? in my views, it adds a number. It only does this if the user does have the permission for the action. Everything else is working perfectly, it's just these annoying numbers! T

[Rails] Simple relation question

2012-03-23 Thread Dano
Hello group, I'm new to Rails and i'm trying to create a 'nested' form for user to a company. I would like the client to be able to create a company in the users sign up form. I get the part were you can choose a company from a collection, but i want to allow the user to create a new company throu

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

2012-03-23 Thread bingo bob
OK Thanks - I've had another think about it but I'd still appreciate any insight if possible. I had wondered if my data model is wrong but I don't think so, it's rather simple. Users have names and Names belong to users. It has to be like this as Users can individually sort their names (so the