[Rails] Re: Some logic problem

2010-03-18 Thread Hemant Bhargava
Hi josh, Thanks for a quickie, But how to get rid of this loop .. Josh Cheek wrote: > Perhaps you have a loop. > > EmployeeX manages EmployeeY and EmployeeY manages EmployeeX -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Grou

Re: [Rails] migration

2010-03-18 Thread David Chua
Care to post your migration script? I suspect you might be creating a table instead of doing a 'add_column" David On Mar 19, 2010 12:58 PM, "Rajkumar Surabhi" wrote: Hi all, I have migrated with some tables in my application. After some days i need to add few more tables to database. The init

Re: [Rails] Some logic problem

2010-03-18 Thread Josh Cheek
On Fri, Mar 19, 2010 at 12:03 AM, Hemant Bhargava wrote: > Hello champs, > > I am in dilemma here. I have structure like this:- > > EmployeeA > | > EmployeeBEmployeeC EmployeeD >

[Rails] Re: Any help on SMS and payment gateway in India

2010-03-18 Thread dare ruby
bramu...@gmail.com wrote: > are you able to find out the free sms gateway in india?? > > On Dec 28 2007, 6:24�pm, Atul Gupta Dear atul and Ramu, could able to find the solution for sms and payment gateway. If so please help me to do the same or else we work together to acheive it. Regards, J

[Rails] Re: free sms gateway in india

2010-03-18 Thread dare ruby
bramu...@gmail.com wrote: > I tried with it but no luck its not working. Any one worked on the sms > service in india?? > > On May 13, 11:23�pm, Marnen Laibow-Koser http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro

[Rails] Some logic problem

2010-03-18 Thread Hemant Bhargava
Hello champs, I am in dilemma here. I have structure like this:- EmployeeA | EmployeeBEmployeeC EmployeeD | | EmployeeE

[Rails] Re: RE: Ruby on Rails Training

2010-03-18 Thread dare ruby
Jamal Soueidan wrote: > Don't forget > > http://railsenvy.com/ > http://railsenvy.com/ > http://railsenvy.com/ > http://railsenvy.com/ mail me at 9994604873 or contact me at 9994604873 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Goo

[Rails] Re: Production Mode.. One liner question

2010-03-18 Thread Hemant Bhargava
Resolved.. We have to pass a RAILS_ENV variable at command line before ruby script/runner.. Cheers .. Xavier Noria wrote: > On Thu, Mar 18, 2010 at 1:00 PM, Hemant Bhargava > wrote: > >> Just a one liner question. I have written a script to put data into >> production database. Where to execu

[Rails] Re: Re: Re: Re: Re: Re: Any training institutes for RoR in India?

2010-03-18 Thread dare ruby
dare ruby wrote: > > martin_mercy2...@gmail.com sorry my email id in gmail is martinmercy2...@gmail.com or else contact me at contact me at 9994604873. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: how to disable a drop down list after selecting one value

2010-03-18 Thread Tony Augustine
great sir.its working now.any way thnks. toogot a logic butt not workn under some specific conditions. this code beats all of those Andy Jeffries wrote: >> >> this is ma code fragment >> >>= f.select :name_type, Setting.unroll(:name_type), { :selected >> => (

[Rails] Re: render a Google Chart to a file

2010-03-18 Thread Brijesh Shah
Use following method to get image in file from any url Net::HTTP.start("#{DOMAIN_URL}") { |http| resp = http.get(PARAMS) open( "#{OUTPUT_DIR}/#{file_name}.png", 'wb' ) { |file| file.write(resp.body) } } Where DOMAIN_URL: http://chart.apis.google.com PARAMS: /ch

[Rails] migration

2010-03-18 Thread Rajkumar Surabhi
Hi all, I have migrated with some tables in my application. After some days i need to add few more tables to database. The initial tables in database have some data. when i try to migrate the database for second time with rake db:migrate it is saying the alredy table exist and rake is aborted. i

[Rails] Will paginate display

2010-03-18 Thread mahesh s
Hi friends i am using will_paginate plugin for pagination Im having more records in my database im listing 10 records per page know my pagination link was look like this << Previous*1* 2 *3* *4* *5* *6* *7* *8* *9* … *266**Next* >> But i would like to display the pagination links look lik

[Rails] Re: RJS error: TypeError: element is null

2010-03-18 Thread Salil Gaikwad
> I believe this is expecting to find a div with id chat_area to > replace. I do not see this div in the code below, though I may be > just not be seeing it. > > Colin Following div is present on my index.rhtml <%= render :partial=>'chat_area' %> I don't know what is the problem with this

[Rails] Rails, 1.9 & Encoding - does it work?

2010-03-18 Thread Donncha ..
Hey all, I've been looking into moving our Rails app to 1.9 and am having lots of trouble with string encodings, especially when it comes to file uploads. We allow users to upload text files, which may, or may not, have accented characters in them. If there are accented characters, we insist that

[Rails] Re: Records created while tests are running are not being saved.

2010-03-18 Thread Vikrant Chaudhary
Just for records. Line #47 - http://code.google.com/p/kopal/source/browse/test/network/connect_controller_test.rb?r=876e7c80c420e5faca9492bd50ed1dd943cb90ac On Mar 18, 3:08 pm, Vikrant Chaudhary wrote: > In following code - > > require "test_helper" > Class SomeControllerTest < ActionController::

[Rails] getting data from a through table

2010-03-18 Thread dan
im using has_many through and the through table has some data i want but i cant seem to access it using straight rails class AttributeObjects < ActiveRecord::Base belongs_to :attributes belongs_to :objects end class Attributes < ActiveRecord::Base has_many :attribute_objects has_many :ob

[Rails] Current CentOS-Nginx-Passenger script?

2010-03-18 Thread InventoryTrackers
I've got bits and pieces of old install scripts but the versions are far out of wack! Anyone recently view or use an install script for all these goodies? Many thanks, David -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this

[Rails] Re: render a Google Chart to a file

2010-03-18 Thread pharrington
On Mar 18, 9:00 pm, Adam Ziemba wrote: > Colin Law wrote: > >     > > open("http://chart.apis.google.com/chart#{CGI.escape('?cht=bvg&chbh=a&chd=s:vttusty&chs=500x300&chxt=x,y&chxl=0:|Sun > > |Mon|Tue|Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12')}") > > do |chart| > >       File.open('chart.png', 'w') {|f

[Rails] Re: Symbol as array index error ?

2010-03-18 Thread Dudebot
On Mar 18, 8:07 pm, Frederick Cheung wrote: > On Mar 19, 12:37 am, Dudebot wrote:> Sorry for being so > dense, but why does > > > @monkey.delete_if{ |k,v| v[ "value" ] == '' } > > > Throw the same error?  Any idea what the proper syntax would be to > > delete the element for which value is blank

[Rails] Rail Quickstart Guide: Always receiving "template missing" errors.

2010-03-18 Thread Stone
Hello, Upon going through the rails quickstart guide: http://guides.rubyonrails.org/getting_started.html & also this guide here: http://fuelyourcoding.com/creating-your-first-ruby-on-rails-application-from-scratch/ - I always get "Missing Template" errors. Specifically: "Template is missing Miss

[Rails] Re: Symbol as array index error ?

2010-03-18 Thread Frederick Cheung
On Mar 19, 12:37 am, Dudebot wrote: > Sorry for being so dense, but why does > > @monkey.delete_if{ |k,v| v[ "value" ] == '' } > > Throw the same error?  Any idea what the proper syntax would be to > delete the element for which value is blank? > Shouldn't do - apart from anything else you're no

[Rails] Re: Re: render a Google Chart to a file

2010-03-18 Thread Adam Ziemba
Colin Law wrote: > > open("http://chart.apis.google.com/chart#{CGI.escape('?cht=bvg&chbh=a&chd=s:vttusty&chs=500x300&chxt=x,y&chxl=0:|Sun|Mon|Tue|Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12')}") > do |chart| > File.open('chart.png', 'w') {|f| f.write chart.read } > end I definitely understa

[Rails] Re: Symbol as array index error ?

2010-03-18 Thread Dudebot
On Mar 18, 4:59 pm, Frederick Cheung wrote: > Because @monkey is a hash what gets yielded to you is an array, the > first element is the key (ie '133' or '145') and the second is the > value, whereas your code seems to assume that x is a hash. Sorry for being so dense, but why does @monkey.dele

[Rails] Re: Rails + Mysql

2010-03-18 Thread José Luis Romero
On Mar 18, 12:36 am, Conrad Taylor wrote: > José, can you verify that MySQL is running by doing the following: > > $ mysql -u Yes it's running... -- 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 rubyo

[Rails] Can't get gems to work

2010-03-18 Thread jackster the jackle
I tried deleting the gem cache and updating gems but I get the following error: [computer1][/]$ gem update --system Upgrading RubyGems... Attempting remote upgrade of rubygems-update Attempting remote installation of 'rubygems-update' Successfully installed rubygems-update-1.3.6 Installing RDoc do

[Rails] Re: undefined method error despite the fact it doesn't exist

2010-03-18 Thread Billee D.
Hi John, I would check your source code in app/views/resources/index.html.haml (or a view helper for that view) for a typo since it's looking for a method named something similar to what you have (e.g change "render_index_row_action_pprove" to "render_index_row_action_approve") HTH On Mar 18, 7:4

[Rails] undefined method error despite the fact it doesn't exist

2010-03-18 Thread John Merlino
Hey all, I'm getting a strange, unexplainable error. It returns undefined method `render_index_row_action_pprove'. I performed a search on my entire application and no such method exists. There is a render_index_row_action_approve but not a render_index_row_action_pprove. NoMethodError in Stude

[Rails] Re: calling a method from a different class's view

2010-03-18 Thread Frederick Cheung
On Mar 18, 10:03 pm, Stu wrote: > When I try to view the page, I get the error: >  Showing app/views/games/show.html.erb where line #8 raised: > > undefined method `get_player_name' for # > > Extracted source (around line #8): > > 5: > 6: > 7:   Player2: > 8:   <%=h Player.get_player_name(@game

[Rails] calling a method from a different class's view

2010-03-18 Thread Stu
Hi all, I have two classes: a player class and a game class. Each game has two player IDs. I would like the game show view to be able to display each player's full name via a method, as follows: <%=h Player.get_player_name(@game.player2) %> Here is the method definition in my players controller:

[Rails] Re: rake db:migrate -> uninitialized constant

2010-03-18 Thread Frederick Cheung
On Mar 18, 7:32 pm, trans wrote: > Hi-- > > I'm trying to do a first migration (2.3.5). I generated a model > "Video", but when I try to migrate I get "uninitialized constant > Videos". Why is it trying to find a plural class name? > Is you migration file called 2010031812456_videos.rb by any ch

Re: [Rails] rake db:migrate -> uninitialized constant

2010-03-18 Thread Colin Law
On 18 March 2010 19:32, trans wrote: > Hi-- > > I'm trying to do a first migration (2.3.5). I generated a model > "Video", but when I try to migrate I get "uninitialized constant > Videos". Why is it trying to find a plural class name? > > Here's more complete output: > > tr...@logisys:models$ rak

[Rails] TEKsystems - Ruby on Rails Job Opportunities

2010-03-18 Thread Sidney
Hi Everyone, I am an IT recruiter with TEKsystems, and I am working with a local client here in New Orleans. This client has a need for multiple Ruby on Rails developers. The position allows for a lot of flexibility. If you are an entry level Ruby developer, they are willing to bring you on board

[Rails] Re: Symbol as array index error ?

2010-03-18 Thread Frederick Cheung
On Mar 18, 9:40 pm, Dudebot wrote: > Anybody have any idea why this is throwing an error: > > @monkey = params[ :lab ][ :existing_lab_data_attributes ] > raise @monkey.to_yaml > > --- !map:HashWithIndifferentAccess > "133": !map:HashWithIndifferentAccess >   unit_id: "2" >   lab_desc_id: "2" >  

[Rails] rake db:migrate -> uninitialized constant

2010-03-18 Thread trans
Hi-- I'm trying to do a first migration (2.3.5). I generated a model "Video", but when I try to migrate I get "uninitialized constant Videos". Why is it trying to find a plural class name? Here's more complete output: tr...@logisys:models$ rake db:migrate --trace ** Invoke db:migrate (first_time

Re: [Rails] Memcached using Unix Domain Sockets?

2010-03-18 Thread Jeffrey L. Taylor
Quoting Jeffrey L. Taylor : > Anyone tried using memcached w/ Unix sockets? Is it faster (for a one host > site) than using the network interface? > Digging into the code makes it clear that memcache-client does not support Unix domain sockets. :( Jeffrey -- You received this message because

[Rails] Symbol as array index error ?

2010-03-18 Thread Dudebot
Anybody have any idea why this is throwing an error: @monkey = params[ :lab ][ :existing_lab_data_attributes ] raise @monkey.to_yaml --- !map:HashWithIndifferentAccess "133": !map:HashWithIndifferentAccess unit_id: "2" lab_desc_id: "2" value: "500" "145": !map:HashWithIndifferentAccess un

[Rails] Re: "require" behaves differently in Rails vs vanilla Ruby?

2010-03-18 Thread Poco Ritard
Ah. Thanks, this makes (more) sense now. On Mar 18, 2:05 am, Frederick Cheung wrote: > The easy way here is torequireconfig/environment which loads up > rails for you. If you just want the const autoloading you can set that > up to but you'll have to delve into the Rails startup stuff to see ho

Re: [Rails] Re: render a Google Chart to a file

2010-03-18 Thread Colin Law
On 18 March 2010 18:50, Adam Ziemba wrote: >> open('http://chart') do |chart| >>    File.open('chart.png', 'w') {|f| f.write chart.read } >> end > > This is wonderful, I knew nothing of open-uri. However, I cannot seem to > get it pull an image. Using the Google link above, which produces a PN

[Rails] not null error from PG on build_other call

2010-03-18 Thread byrnejb
I have this code in a stand alone script that uses nokogiri with activerecord to parse an xml file and initialise a database. begin this_client = correspondent_f.build_client rescue => e puts("Rescued error in build.") puts(e.backtrace) puts(" ") p

[Rails] Facebook style photo uploader

2010-03-18 Thread Ruby on Rails: Talk
Hi Does anyone know of a plugin or something similar which would add the Facebook style photo uploader (or something which will provide the same function)? Thanks in advance. Darren -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To po

Re: [Rails] Re: ruby array inside hash is nil.

2010-03-18 Thread Chris Habgood
Take out the single quotes. On Thu, Mar 18, 2010 at 11:47 AM, mastermike2580 wrote: > i am getting this same exact error message when i try to do a > User.find_by_username('array'). Im have twitter users signed up on my > site and i am trying to find the the users on my site from a > timeline. >

[Rails] Send Java script variable to a controller

2010-03-18 Thread Mohammed Alenazi
I am trying to build an application that has google maps. Inside the script there are two java script variables. I want to send those two variables using a java function. What is the best why to do that. Could someone give me a simple example on that. -- You received this message because you are

[Rails] Modifying a form field and submitting the form using java script

2010-03-18 Thread Mohammed Alenazi
Hi I want to modifying a form field and submitting the form using java script. I know I can do this use basic HTML form code but I want to do it using the rails way. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,

[Rails] Re: Rails development processes running very slow

2010-03-18 Thread Aldric Giacomoni
Alex wrote: > This is a problem I know other people have been having. I'm on Rails > 2.3.5 on a dual core 2.1Ghz Macbook Pro 2.1 with 3Gb of ram and 800Mb+ > inactive memory. Things should be fast. Sometimes things run slowly, > but nothing nearly as slowly as rails. irb starts in milliseconds.

[Rails] Re: Ruby 1.9 loading rails is slow

2010-03-18 Thread Dermot Brennan
Have you tried ruby 1.9.2-dev? On Mar 10, 9:44 pm, Andrius Chamentauskas wrote: > Hello all, > > I've recently started a project and I wanted to give ruby 1.9 + rails > a chance. Well everything works great, so far haven't encountered any > gem that didn't work (so anyone out there you should giv

Re: [Rails] Ruby 1.9 loading rails is slow

2010-03-18 Thread Conrad Taylor
On Wed, Mar 10, 2010 at 2:44 PM, Andrius Chamentauskas wrote: > Hello all, > > I've recently started a project and I wanted to give ruby 1.9 + rails > a chance. Well everything works great, so far haven't encountered any > gem that didn't work (so anyone out there you should give it a try). > Ther

[Rails] Re: Rails development processes running very slow

2010-03-18 Thread ChrisT
I hope someone figures something out with this - I'm having similar issues with ruby 1.9.1 and rails 3 on Windows, Ubuntu 9.04 or 9.10. Nothing I do seems to help with the load time at all (30-60 seconds). On Mar 7, 1:29 am, Alex wrote: > This is a problem I know other people have been having.  

[Rails] Re: Ruby 1.9 loading rails is slow

2010-03-18 Thread ChrisT
I'm having similar issues. I've tried on a Windows box, as well as Ubuntu 9.04 and 9.10 (both of which were VirtualBox with Windows XP as the host, but I tossed all the RAM I could at them). All three environments have rails 3 loading at an unacceptable speed (30-60 seconds before the environment i

[Rails] Re: render a Google Chart to a file

2010-03-18 Thread Adam Ziemba
I managed to get what seems to be a PNG file saved using an actual URL to the image: File.open 'image.png', 'w' do |file| open('http://link_to_image.png').path { |chunk| file.write chunk } end Notice the .png extension which is not present with the Google charts URL. This did save imag

[Rails] Re: render a Google Chart to a file

2010-03-18 Thread Adam Ziemba
> open('http://chart') do |chart| >File.open('chart.png', 'w') {|f| f.write chart.read } > end This is wonderful, I knew nothing of open-uri. However, I cannot seem to get it pull an image. Using the Google link above, which produces a PNG image, I get the error "bad URI(is not URI?)".

[Rails] differences between relative_url using Rails with Prototype or JQuery

2010-03-18 Thread Erwin
My web app is deployed with Passenger in a sub-uri, http://www.mydomain.com/vacademy/ and I am displaying a player in a page the swf is located in ../public/dist/flowplayer-3.1.5.swf Using Prototype library I wrote a script :

[Rails] PAM Authentication

2010-03-18 Thread Evaldo Kalbermatter
Hello everyone! I'm trying to use PAM in my application and found the gem of Authlogic and rpam. I could not install either the lack of information. Someone has managed to do it? Google's everywhere and found nothing. If you can help me I will be very grateful. Have a nice day. -- Posted via http:

Re: [Rails] Re: Routing Error on rails3

2010-03-18 Thread Felipe Rodrigues
Rails 3 doesn't come with a generic rout mapping for controllers. The generator for models or scaffold will add the models as resources routes, so it will be RESTfull by default. It means that in any new rails 3 app, you will have to explicitly change the routes.rb to add the routes that are n

[Rails] Re: Records created while tests are running are not being saved.

2010-03-18 Thread Frederick Cheung
On Mar 18, 10:13 am, Steven Hilton wrote: > On Thu, Mar 18, 2010 at 6:08 AM, Vikrant Chaudhary wrote: > > Tests are ran inside a transaction and are rolled back after each > test. In a separate process (i.e. ./script/dbconsole) you will not see > the data create from a test, even if you pause e

[Rails] Re: Re: Re: Re: ERROR NoMethodError: private method `gsub!' called

2010-03-18 Thread Chris Mentch
>> >> Well, I executed "gem install mongrel", then "ruby script/server >> webrick" and everything is loading!! > > I presume you mean "ruby script/server mongrel" > > Colin Yes... Sorry. Webrick still on the mind. ruby script/server mongrel Works! -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Problem about "each" in rails

2010-03-18 Thread tomkurt
If you want the names seperated by comma, try this: <%=h @posts.map{|p| p.name}.join(', ') %> On 18 mrt, 17:48, Michael Pavling wrote: > On 18 March 2010 16:33, Grick Zh wrote: > > > <%=h @posts.each {|p| p.name} %> > > > why this code return serial strings like # ? > > Because you're outputtin

[Rails] Re: ruby array inside hash is nil.

2010-03-18 Thread mastermike2580
i am getting this same exact error message when i try to do a User.find_by_username('array'). Im have twitter users signed up on my site and i am trying to find the the users on my site from a timeline. When i try <%= User.find_by_username('status.user.screen_name') %> It returns nil, but if i us

[Rails] Re: HABTM Associations In View

2010-03-18 Thread mastermike2580
try this. <%= n.select :purchase_item_id, PurchaseItem.all.collect {|a| [a.name, a.id] }, @recipe.purchase_item.id %> Havent tested it so it may or may not work. On Mar 18, 7:44 am, Andy wrote: > Hello, > I wish I had the time to figure this out but I'm on a limited timeline > to convince peopl

Re: [Rails] Re: Re: Re: ERROR NoMethodError: private method `gsub!' called

2010-03-18 Thread Colin Law
On 18 March 2010 17:36, Chris Mentch wrote: >> >> Out of interest have you tried mongrel? >> script/server mongrel >> >> Otherwise I am out of my depth I am afraid. >> >> Colin > > Well, I executed "gem install mongrel", then "ruby script/server > webrick" and everything is loading!! I presume yo

[Rails] Re: Re: Re: ERROR NoMethodError: private method `gsub!' called

2010-03-18 Thread Chris Mentch
> > Out of interest have you tried mongrel? > script/server mongrel > > Otherwise I am out of my depth I am afraid. > > Colin Well, I executed "gem install mongrel", then "ruby script/server webrick" and everything is loading!! What a bad problem with webrick. My staging server is mongrel, b

[Rails] Memcached using Unix Domain Sockets?

2010-03-18 Thread Jeffrey L. Taylor
Anyone tried using memcached w/ Unix sockets? Is it faster (for a one host site) than using the network interface? TIA, Jeffrey -- 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-t...@goog

Re: [Rails] Re: Re: ERROR NoMethodError: private method `gsub!' called

2010-03-18 Thread Colin Law
On 18 March 2010 17:03, Chris Mentch wrote: >... > What is odd is that I even created a new rails app from scratch and it > is also having the same problem serving up anything from the public > folder---stylesheets, javascripts, images, etc...  If I start webrick on > this new app, it appears that

[Rails] Re: Re: ERROR NoMethodError: private method `gsub!' called

2010-03-18 Thread Chris Mentch
Colin Law wrote: > > You can tell whether it changed anything by checking your current > version against the version in your version control repository. If > you are not using one (git for example) start by setting one up. When > messing about upgrading rails and so on you need to be able to tra

[Rails] Re: Re: ERROR NoMethodError: private method `gsub!' called

2010-03-18 Thread Chris Mentch
As much of the trace as I can get from my Windows command prompt. It doesn't log this to log/development.log. You'll see GET calls and then the 500 error followed by the "private method `gsub!'" error message repeatedly. Seems to affect all of the static files---stylesheets, javascripts, ima

Re: [Rails] Problem about "each" in rails

2010-03-18 Thread Michael Pavling
On 18 March 2010 16:33, Grick Zh wrote: > <%=h @posts.each {|p| p.name} %> > > why this code return serial strings like # ? Because you're outputting the return value of the whole loop, not the output of each block. If you run that command in your console, you will see it return an array of Posts

[Rails] Problem about "each" in rails

2010-03-18 Thread Grick Zh
CODE1: <% @posts.each do |p|%> <%=h p.name %> <% end %> this will show the name string like "Tom" in the web page. CODE2: <%=h @posts.each {|p| p.name} %> why this code return serial strings like # ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are su

[Rails] Re: rails+prawnto: setting :type to :prawn in a #render_to_string call not working

2010-03-18 Thread Kendall Gifford
On Mar 18, 3:04 am, Michael Pavling wrote: > > In the end, I wrote some wholly ugly code to get around > it:http://www.workingwithrails.com/forums/4-ask-a-rails-expert/topics/80...http://groups.google.com/group/prawn-ruby/browse_thread/thread/185977... > > ... my solution was certainly frowned o

Re: [Rails] RJS error: TypeError: element is null

2010-03-18 Thread Colin Law
On 18 March 2010 15:33, Salil Gaikwad wrote: > Hi All, > > I got RJS error: TypeError: element is null while using ajax. > > I used  in view > > <%= periodically_call_remote(:url=>{:action=>'get_user_list', :id=>'1'}, > :frequency => '5') %> > > in controller > >      render :update do |page| >  

[Rails] RJS error: TypeError: element is null

2010-03-18 Thread Salil Gaikwad
Hi All, I got RJS error: TypeError: element is null while using ajax. I used in view <%= periodically_call_remote(:url=>{:action=>'get_user_list', :id=>'1'}, :frequency => '5') %> in controller render :update do |page| page.replace_html 'chat_area', :partial => 'chat_area', :ob

[Rails] Re: Records created while tests are running are not being saved.

2010-03-18 Thread Vikrant Chaudhary
Thanks. On Mar 18, 3:13 pm, Steven Hilton wrote: > On Thu, Mar 18, 2010 at 6:08 AM, Vikrant Chaudhary wrote: > > In following code - > > > require "test_helper" > > Class SomeControllerTest < ActionController::TestCase > > >  def test_something > >    record = SomeModel.create :name => 'test' >

[Rails] HABTM Associations In View

2010-03-18 Thread Andy
Hello, I wish I had the time to figure this out but I'm on a limited timeline to convince people to look at RoR instead of Drupal, so I need to get something relatively simple working fast. Any help or pointers would be appreciated! I have two HABTM many models, recipe_item and purchase_item. I ne

[Rails] Re: When -exactly- does the Rails3 application get initialized?

2010-03-18 Thread Bob Martens
Anyone else with this? I'm running into a similar situation with CarrierWave where during initialization (using unicorn for testing) I can't get it to load because Rails.root is nil and they can't join nil with a string. Any help here would be greatly appreciated. How have others got around this?

[Rails] Problem with db:test:prepare

2010-03-18 Thread Thiel Chang
Hi, I am learning Rails from "Agile Web Development with Rails" (third edition) by implementing the Depot example. This is an excellent book to learn Rails. However, I have a problem in the chapter 14, Testing, in which I had to run the command: db:test:prepare. It gave the following result;

[Rails] Re: hash in controller is nil after submitting form

2010-03-18 Thread ES
ok, thanks! On Mar 18, 3:24 pm, Colin Law wrote: > On 18 March 2010 14:16, ES wrote: > > > hmmm, I'm totally new to this, what exactly is a helper used for?  For > > these kinds of constant-type things in a view? > > This is a reasonable introduction > -http://paulsturgess.co.uk/articles/show/4

Re: [Rails] Re: hash in controller is nil after submitting form

2010-03-18 Thread Colin Law
On 18 March 2010 14:16, ES wrote: > hmmm, I'm totally new to this, what exactly is a helper used for?  For > these kinds of constant-type things in a view? This is a reasonable introduction - http://paulsturgess.co.uk/articles/show/49-using-helper-methods-in-ruby-on-rails Colin -- You received

[Rails] Re: hash in controller is nil after submitting form

2010-03-18 Thread ES
hmmm, I'm totally new to this, what exactly is a helper used for? For these kinds of constant-type things in a view? On Mar 18, 3:08 pm, Colin Law wrote: > On 18 March 2010 13:53, ES wrote: > > > yes I am going through create, should I make the @columns hash a class > > variable or just repopul

Re: [Rails] Testing best practice

2010-03-18 Thread Rick DeNatale
On Thu, Mar 18, 2010 at 7:57 AM, Rails Fun wrote: > so what is the best way test bed to use for a rails project? > i'm thinking of using Rspec and Cucumber, but where do you do the unit > tests? in Rspec? Yes -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.co

Re: [Rails] Re: hash in controller is nil after submitting form

2010-03-18 Thread Colin Law
On 18 March 2010 13:53, ES wrote: > yes I am going through create, should I make the @columns hash a class > variable or just repopulate it in the create method? You could populate it in a before or after_filter on those actions. I have to say that the whole thing looks a bit odd. Are you sure

Re: [Rails] Re: hash in controller is nil after submitting form

2010-03-18 Thread Michael Pavling
On 18 March 2010 13:53, ES wrote: > yes I am going through create, should I make the @columns hash a class > variable or just repopulate it in the create method? You can do it however you like; you just need to make sure it's not nil ;-) Personally... I would make a decision based on the object

[Rails] Re: hash in controller is nil after submitting form

2010-03-18 Thread ES
yes I am going through create, should I make the @columns hash a class variable or just repopulate it in the create method? On Mar 18, 2:49 pm, Michael Pavling wrote: > On 18 March 2010 13:43, ES wrote: > > > the first time I load the page, the correct form displays but then > > when I click sub

Re: [Rails] hash in controller is nil after submitting form

2010-03-18 Thread Colin Law
On 18 March 2010 13:43, ES wrote: > I'm trying to create a data entry form but getting an error when it > sumbmits.  I am using an hash to get the names of the fields definied > in the controller's "new" function: > >  def new >   �...@thing = thing.new >   �...@columns = Hash.new > >   �...@colum

Re: [Rails] hash in controller is nil after submitting form

2010-03-18 Thread Michael Pavling
On 18 March 2010 13:43, ES wrote: > the first time I load the page, the correct form displays but then > when I click submit, I get this error : > > You have a nil object when you didn't expect it! > You might have expected an instance of ActiveRecord::Base. > The error occurred while evaluating n

[Rails] hash in controller is nil after submitting form

2010-03-18 Thread ES
I'm trying to create a data entry form but getting an error when it sumbmits. I am using an hash to get the names of the fields definied in the controller's "new" function: def new @thing = thing.new @columns = Hash.new @columns['thing_general'] = [ ["title","name"],

Re: [Rails] how to disable a drop down list after selecting one value

2010-03-18 Thread Andy Jeffries
> > this is ma code fragment > >= f.select :name_type, Setting.unroll(:name_type), { :selected > => (@name.name_type || "mathew").to_sym }, { :style => > "width:300px",:disabled => "true" } > > here name_type is the name of variable declared in d xml file with > that names.so what

Re: [Rails] Re: One-time script to update 1000s of values in a single column in a table: nil error?

2010-03-18 Thread Michael Pavling
On 18 March 2010 12:18, Clay H. wrote: > What exactly does the "...in place" part of that mean? > > On Mar 18, 4:42 am, Michael Pavling wrote: >> The "gsub bang" method returns nil if no changes are made: it's a >> method for changing string variables in place, not really for >> assigning the ret

[Rails] MailChimp API recommendations?

2010-03-18 Thread Hassan Schroeder
This page - - lists five gems/plugins for interacting with the MailChimp service, and for all I know there are others. Anyone have a personal recommendation? Based on any of stability, ease of integration, completeness, whatever... TIA, -- Hassan Schroed

Re: [Rails] Production Mode.. One liner question

2010-03-18 Thread Xavier Noria
On Thu, Mar 18, 2010 at 1:00 PM, Hemant Bhargava wrote: > Just a one liner question. I have written a script to put data into > production database. Where to execute that script ? For scripts sometimes I create a bin directory. Those are run with script/runner. -- You received this message bec

[Rails] Re: Sending mail using action mailer

2010-03-18 Thread Saravanan Doraiswamy
Hi, In this mean time, i downloaded a youtube video and followed the procedure, now i am getting this error : E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing' E:/Users/Jithu/RubyMails/gmailer/app/controllers/notifications_controller.r

Re: [Rails] Re: how to disable a drop down list after selecting one value

2010-03-18 Thread Colin Law
On 18 March 2010 12:04, Tony Augustine wrote: > Colin Law wrote: >> On 18 March 2010 05:30, Tony Augustine wrote: >>> >>> here name_type is �the �name �of variable declared in �d �xml file with >>> that �names.so �what �should b �code � �4 �disabled >> >> Assuming there are separate views for new

[Rails] Re: One-time script to update 1000s of values in a single column in a table: nil error?

2010-03-18 Thread Clay H.
What exactly does the "...in place" part of that mean? On Mar 18, 4:42 am, Michael Pavling wrote: > On 18 March 2010 02:26, Clay H. wrote: > > > Stock.rb > > ^ > >  self.strength = self.strength.gsub!(' ml', 'ml') if > > The "gsub bang" method returns nil if no changes are made: it's a >

[Rails] Re: Sending mail using action mailer

2010-03-18 Thread Bigos
if it is not enough, look for clues in log files in railsapp/log making sure you check logs relevant to mode you run your app, eg. development.log if there's nothing there you need to configure your railss application to send mails and report errors. My railsapp/config/environments/development.rb

[Rails] Re: how to disable a drop down list after selecting one value

2010-03-18 Thread Tony Augustine
Colin Law wrote: > On 18 March 2010 05:30, Tony Augustine wrote: >> >> here name_type is �the �name �of variable declared in �d �xml file with >> that �names.so �what �should b �code � �4 �disabled > > Assuming there are separate views for new and edit then just disable > it in the edit view. >

Re: [Rails] One-time script to update 1000s of values in a single column in a table: nil error?

2010-03-18 Thread Colin Law
On 18 March 2010 02:26, Clay H. wrote: > Hi, I have a model called Stock with a value called "strength." I > wrote a simple method in the Stock.rb model file to update the value > of "strength" for each record in the stocks table. I created a > controller called fix_controller.rb. I don't have acc

[Rails] ActiveMerchant unit tests

2010-03-18 Thread Commander Johnson
Hi, I'm testing my ActiveMerchant plugin installation with the iDeal payment method. One test keeps failing even though I've inserted all the credentials. The other test file, remote_ideal_test.rb, completes 100% of the tests with the same credentials. Any thoughts on this error? Best regards, C

[Rails] Production Mode.. One liner question

2010-03-18 Thread Hemant Bhargava
Hello Champs, Just a one liner question. I have written a script to put data into production database. Where to execute that script ? -- 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 t

[Rails] Testing best practice

2010-03-18 Thread Rails Fun
so what is the best way test bed to use for a rails project? i'm thinking of using Rspec and Cucumber, but where do you do the unit tests? in Rspec? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send em

[Rails] Re: Sending mail using action mailer

2010-03-18 Thread Loganathan Ganesan
Saravanan Doraiswamy wrote: > Hi everyone, > > I am new to ruby and i just wanna send an email using ruby action > mailer. i have been trying it for about a day. Not achieved. so many > replies came in from google but many were beating the bushes .. > > can any one send me a correct procedure.. >

[Rails] Re: REST and security ...

2010-03-18 Thread Sharagoz --
Michael Pavling wrote: > On 18 March 2010 10:30, Pasalic Zaharije > wrote: >> Is there any standard (Rails) way for doing this? Any ideas how to fit >> user rights model into rails app? > > Googling for "rails role based permissions" will give you several > articles discussing this problem. > Th

Re: [Rails] how to disable a drop down list after selecting one value

2010-03-18 Thread Colin Law
On 18 March 2010 05:30, Tony Augustine wrote: > my  question is i  have  a  drop down list to  choose  some vales from > an  xml file.after selecting one vaale  and  saving  it will b   saved. > but  when i tried to edit that  it should  be   disabled. can any one > provide  solutions > > this  is

  1   2   >