[Rails] New to rails, model design advice needed

2011-09-12 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] Re: Reusing the model to write a CLI

2011-09-12 Thread Norm Scherer
On 09/12/2011 05:53 PM, maskiran wrote: say its a basic blog application that has web UI (myblog.com/posts/ new) is an action to add a new post and it shows up a web page with 'title' and 'content' field in the GUI that the end user fills in and saves Now I want to do the same thing using a CLI.

[Rails] Re: Ajax and rails 3 UJS (jquery)

2011-09-12 Thread K.M.
> Where does your the syntax for the event name 'ajax:success' come from? > In prototype you can use the event name 'dom:loaded', although I can't > find much information about where that name comes from either, but in > any case that is prototype--not jQuery. I picked it up from http://railsdog

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

2011-09-12 Thread Robert Walker
maskiran wrote in post #1021560: > say its a basic blog application that has web UI (myblog.com/posts/ > new) is an action to add a new post and it shows up a web page with > 'title' and 'content' field in the GUI that the end user fills in and > saves > > Now I want to do the same thing using a CL

[Rails] Re: Storing form data in xml file

2011-09-12 Thread 7stud --
> How can I use this model to write a CLI program, Well, you might offer random people $100 so that you can get them to read through all your specs. Then you can pay someone $5,000 to write the code for you. gl -- Posted via http://www.ruby-forum.com/. -- You received this message because

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

2011-09-12 Thread maskiran
say its a basic blog application that has web UI (myblog.com/posts/ new) is an action to add a new post and it shows up a web page with 'title' and 'content' field in the GUI that the end user fills in and saves Now I want to do the same thing using a CLI. I login into the server using ssh, then s

[Rails] Re: "Isn't precompiled" message while compiling

2011-09-12 Thread Christopher Thielen
Nevermind, this is apparently a known issue. Setting the config's precompile to true will workaround it for now. On Sep 12, 2011, at 5:13 PM, Christopher Thielen wrote: > I have one JS library that references image assets in > /app/assets/images/subdir/. > > When I execute "bundle exec rake as

[Rails] "Isn't precompiled" message while compiling

2011-09-12 Thread Christopher Thielen
I have one JS library that references image assets in /app/assets/images/subdir/. When I execute "bundle exec rake assets:precompile RAILS_ENV=production", I receive an error that the image file in /subdir/ isn't precompiled ... while I'm telling it to compile all assets. I've tried clearing o

[Rails] bundle install ignoring :git?

2011-09-12 Thread Christopher Thielen
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 from git via the :git => syntax in Gemfile. Logging into the production server and ty

Re: [Rails] Re: problem using mysql 5.1 with RoR 3.1

2011-09-12 Thread Hassan Schroeder
On Mon, Sep 12, 2011 at 12:42 PM, Nara wrote: > I also gem installed mysql, and changed everything in database.yml to > mysql. Still the same issue with ActiveRecord failing to connect. I will go > back to using mysql2 Have you tried generating a new rails app starting out with mysql? e.g. % rail

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

2011-09-12 Thread Colin Law
On 12 September 2011 18:31, maskiran wrote: > Hi, > I am beginner to Rails. So far has been a happy PHP developer. I wrote > a beginner application in rails. this has been working very good for > the web. I want to re-use the model to write views in CLI. You want to re-use the model to write view

[Rails] Reusing the model to write a CLI

2011-09-12 Thread maskiran
Hi, I am beginner to Rails. So far has been a happy PHP developer. I wrote a beginner application in rails. this has been working very good for the web. I want to re-use the model to write views in CLI. How can i do this? I searched on google and could not find a good solution to this one. -- You

[Rails] Storing form data in xml file

2011-09-12 Thread maskiran
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 file. Users write the perl script in the form and save it to the server (which

[Rails] Migrate column from text to binary (PostgreSQL)

2011-09-12 Thread Alex Shulgin
Hello, So I've realized one of the columns in a table has to be binary instead of text. However, a straightforward change_column :my_table, :my_column, :binary fails under PostgreSQL (9.x series) The error message being: PGError: ERROR: column "my_column" cannot be cast to type bytea : ALTER

[Rails] Re: couldn't find file 'jquery' rails 3.1 stable mountable engine

2011-09-12 Thread tothemario
I had the same problem and finally fixed. The solution is to explicitly require the 'jquery-rails' gem in the dummy config/application.rb file, so Sprockets can add the jquery assets in the assets.path. In test/dummy/config/application.rb require File.expand_path('../boot', __FILE__) # P

[Rails] Re: Image upload with progress bar

2011-09-12 Thread Manny 777
I tried to debug my script and all session variable are destroyed in a moment, when I click on the button "upload" (that run the function runit()) - I am not sure, could be here the problem? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to t

Re: [Rails] Re: problem using mysql 5.1 with RoR 3.1

2011-09-12 Thread Greg Reinacker
Don't know if it will help, but try something like development: adapter: mysql2 encoding: utf8 database: mblogdev username: nara password: host: server_ip_addr_here -GR On Sep 12, 2011, at 1:42 PM, Nara wrote: > I also gem installed mysql, and changed everything in database.yml to

[Rails] Re: problem using mysql 5.1 with RoR 3.1

2011-09-12 Thread Nara
I also gem installed mysql, and changed everything in database.yml to mysql. Still the same issue with ActiveRecord failing to connect. I will go back to using mysql2, and hopefully, get some help on this group. I will also try the mysql blog author at excid3.com. If I can somehow get mysql2 to wor

[Rails] Re: question about a where condition

2011-09-12 Thread John Merlino
thanks for responses -- 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...@googlegroups.com. For

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

2011-09-12 Thread Michael Pavling
On 12 September 2011 15:13, Dave Aronson wrote: > On Mon, Sep 12, 2011 at 09:59, 7stud -- wrote: > >> I also suggest that you go read a beginning html tutorial. > > Howzabout, rather than just getting all snarky, you point out to Joan > and me, what's going wrong?  MINSWAN, remember? +1 I've be

[Rails] How to get the image_path in production without the asset host?

2011-09-12 Thread Bruno Grasselli
Hi guys, I would like to know how to get the image_path in production environment without the asset host (using rails 3.1). There is the image_path helper that returns the image path with md5 and (if set, and it is set) the asset host, but we have not found a way to get the path without the host.

[Rails] Re: Image upload with progress bar

2011-09-12 Thread Manny 777
Well, I'm now a bit confused - in your tutorial - you don't use the "form" - there are only input tags, without start & stop mark of form (there is nothing like "<%= form_tag({ :controller => 'photos', :action => 'upload' }, { :multipart => true, :remote => true}) do %>") -- Posted via http://

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

2011-09-12 Thread tom
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 after_sign_in_path_for(resource)        puts request.session_options.inspect .. end log: {:renew=>

[Rails] Re: chunk

2011-09-12 Thread 7stud --
result = [2, 4, 1, 3, 5, 6, 8].chunk do |num| num.even? end result.each do |even_result, a_chunk| p [even_result, a_chunk] end --output:-- [true, [2, 4]] [false, [1, 3, 5]] [true, [6, 8]] e = DATA.chunk do |line| ascii_code_for_first_letter = line.ord end e.each do |ascii_code, lin

[Rails] Job Opportunity

2011-09-12 Thread Christos Alexakis
We are a highly exciting European start-up company aiming to build the leading marketplace for private apartments. Wimdu was founded earlier this year is now built up rapidly by a high-performing team of developers and entrepreneurs. We currently host >12’000 properties in more than 50 countries on

[Rails] Re: New to Rails relationship route problem

2011-09-12 Thread Tim Shaffer
Can you post the code for the file that is causing the error? It should be displayed in your console/log. Just a guess here, but most likely there is some code that redirects to a note_path that may need to be updated to point to a site_note_path. -- You received this message because you are s

[Rails] Re: chunk

2011-09-12 Thread Frederick Cheung
On Sep 12, 10:18 am, Jean-René Saint-Etienne wrote: > Hi, > > I am a beginner in ruby and It try to undertand the concept of > "enum.chunk" in particular these 2 exemples (http://ruby-doc.org/core/ > classes/Enumerable.html#M003131) > it groups consecutive elements according to the value of the

[Rails] Re: Captcha conception

2011-09-12 Thread Misha Ognev
Thanks, this really works. Can you tell me lesson of rails routing other than guides.rubyonrails.org? (I cannot understand some things here) -- 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 p

[Rails] Re: Captcha conception

2011-09-12 Thread Frederick Cheung
On Sep 12, 1:16 pm, Misha Ognev wrote: > Fred, I understand a simple_captcha conception. Now I faced with this > problem: > > I create an captcha_controller.rb, when in def generate... end I put a > code to create captcha image. > > Then I write in config/routes.rb: > > > match 'captcha' => 'cap

[Rails] Startup City 2011 (September 24th,Mumbai)

2011-09-12 Thread vimala 123
Hi, Ever dreamt of being Bill Gates or Steve Jobs? If you have the entrepreneurial bug in you, don't miss the biggest event for Startups -- StartupCity. Roll up your Sleeves. Meet over 100 'cool startups' at the Startup City on September 24, 2011 at Ms Subbu Lakshmi Auditorium,Mumbai. You can mee

[Rails] New to Rails relationship route problem

2011-09-12 Thread OES
Hi Folks. Hope you can advise a newbie to rails. I have to models set up Site & Note. A site can have many notes where a note belongs to a site. My 2 models are. class Note < ActiveRecord::Base belongs_to :site end class Site < ActiveRecord::Base has_many :notes end Within the routes I se

[Rails] Converting media to m4v format using ffmpeg

2011-09-12 Thread 0v3rr!d3
Can anyone help me convert media to m4v format. I guess ffmpeg would be a nice choice coz I have a rails application where I need to do the conversion. I google, but could not find the solution. BTW I am using jplayer for playing video which only takes m4v video file and thats the reason I need to

[Rails] chunk

2011-09-12 Thread Jean-René Saint-Etienne
Hi, I am a beginner in ruby and It try to undertand the concept of "enum.chunk" in particular these 2 exemples (http://ruby-doc.org/core/ classes/Enumerable.html#M003131) " open("/usr/share/dict/words", "r:iso-8859-1") {|f| f.chunk {|line| line.ord }.each {|ch, lines| p [ch.chr, lines.length

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

2011-09-12 Thread Frederick Cheung
On Sep 12, 4:37 am, Joan Gu wrote: > Code: > <%= check_box("schedule_report", "active_#{id}", > options={:id=>"schedule_report_#{id}_active", :checked > =>schedule_report.active }, 1, 0) %> > > Rendered output: > > name="schedule_report[active_20]" checked="checked"> > > > name="schedule_rep

Re: [Rails] Re: EngineYard deploy - Vanilla Database

2011-09-12 Thread Dr Nic Williams
Thanks Kevin. However you wish to load data, the migration task can take a command and it's output is included in the deploy logs. Nov -- 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-tal

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

2011-09-12 Thread Dave Aronson
On Mon, Sep 12, 2011 at 09:59, 7stud -- wrote: > I also suggest that you go read a beginning html tutorial. Howzabout, rather than just getting all snarky, you point out to Joan and me, what's going wrong? MINSWAN, remember? -Dave -- Main Web Site: davearonson.com | LOOKING FOR WORK, Program

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

2011-09-12 Thread 7stud --
Dave Aronson wrote in post #1021425: > On Sun, Sep 11, 2011 at 23:37, Joan Gu wrote: > >> >> > name="schedule_report[active_17]"> >> ... >> >> Problem: >> The value of "1" is always passed, even if the box is UNCHECKED. >> Please help! > > Passed to your browser as evidenced by the above rend

Re: [Rails] Re: EngineYard deploy - Vanilla Database

2011-09-12 Thread Kevin Bedell
http://www.kbedell.com/2011/03/15/seed-data-versus-testing-data-and-custom-rake-tasks-for-ruby-on-rails/ Here's a blog post I wrote on this subject with some sample code. It covers the difference between loading 'seed' data which is intended to live as a permanent part of the production database (

[Rails] Re: EngineYard deploy - Vanilla Database

2011-09-12 Thread paulo
Great - just what I was looking for with the db:seed command - thanks Paul On Sep 12, 1:46 pm, Dr Nic wrote: > When you deploy you can specify a migration task. By default it is "rake > db:migrate". For your new applications, try "rake db:migrate db:seed", where > db:seed is the Rails 3 hook fo

[Rails] Re: EngineYard deploy - Vanilla Database

2011-09-12 Thread Dr Nic
When you deploy you can specify a migration task. By default it is "rake db:migrate". For your new applications, try "rake db:migrate db:seed", where db:seed is the Rails 3 hook for setting up new database content. Remember to change your migration field back to "rake db:migrate" after the firs

[Rails] Rspec error while running jruby -S rake spec

2011-09-12 Thread Chandu80
Hello All, I followed steps to install Rspec as in the link pasted below. http://www.pmamediagroup.com/2009/04/tutorial-install-rspec-rails-factory-girl/ I have jRuby on Rails installed on my machine.Hence all commands need to be run with jruby -S extension. However when I run the jruby -S rake

Re: [Rails] Re: bundle install question

2011-09-12 Thread Craig White
On Sun, 2011-09-11 at 07:33 +0200, Robert Walker wrote: > Craig White wrote in post #1021199: > > Having a problem... > > > > I am working on a project where I am using bundle & Gemfile and it's > > working OK. The gems are all installed and a few git based gems are in > > my ~/.bundler/ruby/1.8 di

[Rails] Re: Captcha conception

2011-09-12 Thread Misha Ognev
Fred, I understand a simple_captcha conception. Now I faced with this problem: I create an captcha_controller.rb, when in def generate... end I put a code to create captcha image. Then I write in config/routes.rb: > match 'captcha' => 'captcha/generate' And in _generator.html.erb: > <%= imag

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

2011-09-12 Thread Dave Aronson
On Sun, Sep 11, 2011 at 23:37, Joan Gu wrote: > Code: > <%= check_box("schedule_report", "active_#{id}", > options={:id=>"schedule_report_#{id}_active", :checked > =>schedule_report.active }, 1, 0) %> > > Rendered output: > > name="schedule_report[active_20]" checked="checked"> > > > name="sc

[Rails] Re: Image upload with progress bar

2011-09-12 Thread Ron Phillips
Do all kinds of form uploads, even those without multipart data, destroy your session variables? If so, then it doesn't sound like the photo upload is the root of the problem. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Group

Re: [Rails] Re: installing ruby gems

2011-09-12 Thread Michael Pavling
On 12 September 2011 11:07, Annapoorna R wrote: > thanks jim, > installed rubygem > installing rails2.3.9 using sudo gem install rails -v=2.3.9 > ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError) >     timed out (http://rubygems.org/gems/rails-2.3.9.gem) > i searched with this error

Re: [Rails] Re: installing ruby gems

2011-09-12 Thread Annapoorna R
thanks jim, installed rubygem installing rails2.3.9 using sudo gem install rails -v=2.3.9 ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) timed out (http://rubygems.org/gems/rails-2.3.9.gem) i searched with this error..but no result.. ??? On Mon, Sep 12, 2011 at 1:02 PM, Jim R

[Rails] EngineYard deploy - Vanilla Database

2011-09-12 Thread paulo
Hi folks, Just after a 'best-practise' recommendation here really, I am deploying a series of applications to EY and for each one, need to setup the database with some default settings / user account etc etc. What is the best way to write a few initial rows to a vanilla database? I've looked into

Fwd: [Rails] newbie: rails3 session & access via php

2011-09-12 Thread tom
hi, i switched to activerecord store and im using devise. def after_sign_in_path_for(resource) puts "...after_sign_in_path_for" puts request.session_options[:id].to_s >> i get no session information, althought the code works fine in the

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

2011-09-12 Thread soldier.coder
Sheng-Loong, I bet no one wants to have to go to a site, agree to licensing agreement, and then fill out a form so they can help you with your problem. The morale of the story is: if you want help, make it easy for people to see your problem On Sep 11, 6:57 am, shengloong wrote: > Hi all, > > I

[Rails] Re: hosting ror app using xampp on windows OS

2011-09-12 Thread manikyala rao padala
thank u colin, at present i am doing my best to host sample ror app into apache in win os. i modified httpd.conf file to listen 3000 port Listen 3000 LoadModule rewrite_module modules/mod_rewrite.so ServerName rails DocumentRoot "D:/xampp/htdocs/samplerorapp/public" Options ExecCGI FollowSymLinks

Re: [Rails] Problem in installing rails 3.1.0

2011-09-12 Thread Jim Ruther Nill
On Mon, Sep 12, 2011 at 3:04 PM, kevin peter wrote: > Hi , > > Presently i am installing rails in my ubuntu system(Ubuntu 10.04.3 LTS) > > using following commad > gem install rails -v ">=3.1.0" > > use gem install rails -v=3.1.0 > When i am trying to install > desk@desk-pc:~$ gem install rail

Re: [Rails] Re: Problem in installing rails 3.1.0

2011-09-12 Thread Zolzaya Erdenebaatar
Can you post your errors? Which ruby version do you use in default? On Mon, Sep 12, 2011 at 3:29 PM, kevin peter wrote: > Hi Zolzaya, > > > Thank you for your reply. Presently I am using rvm only > > rvm list > > rvm rubies > > => ruby-1.9.2-p290 [ i386 ] > ruby-1.8.6-p420 [ i386 ] > ruby-1.

Re: [Rails] Re: installing ruby gems

2011-09-12 Thread Jim Ruther Nill
On Mon, Sep 12, 2011 at 2:41 PM, Annapoorna R wrote: > fred, > > wget -chttp://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz > i am not getting with the above path i removed -c n downloaded.. but wen > i run ruby setup.rb inside rubygem > i get the following error > ./lib/rubygems

Re: [Rails] newbie: rails3 session & access via php

2011-09-12 Thread tom
u mean no two? and then pass the sessionid via url? thx On Sun, Sep 11, 2011 at 7:51 PM, Zolzaya Erdenebaatar wrote: > I think yes. You should store your session to database and access it via > php. > > On Sun, Sep 11, 2011 at 7:52 PM, tom wrote: >> >> hi, >> im having a working rails3 app with

[Rails] Re: Problem in installing rails 3.1.0

2011-09-12 Thread kevin peter
Hi Zolzaya, Thank you for your reply. Presently I am using rvm only rvm list rvm rubies => ruby-1.9.2-p290 [ i386 ] ruby-1.8.6-p420 [ i386 ] ruby-1.8.7-p352 [ i386 ] Here I have rvm also latest version[rvm 1.8.3 ]. I am trying to instal using the ruby version (ruby-1.9.2-p290 [ i386

[Rails] Re: installing ruby gems

2011-09-12 Thread Frederick Cheung
On Sep 12, 7:41 am, Annapoorna R wrote: > fred, >   wget -chttp://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz >   i am not getting with the above path  i removed -c n downloaded.. but wen > i run ruby setup.rb inside  rubygem > i get the following error > ./lib/rubygems.rb:10:in `req

Re: [Rails] Problem in installing rails 3.1.0

2011-09-12 Thread Zolzaya Erdenebaatar
gem install rails --- this command going to install rails latest version. Just try this. Do you know RVM (Ruby enVironment manager). Most rails developers use this tools. I'm recommended it to you. Please check it. On Mon, Sep 12, 2011 at 3:04 PM, kevin peter wrote: > Hi , > > Presently i am ins

[Rails] Problem in installing rails 3.1.0

2011-09-12 Thread kevin peter
Hi , Presently i am installing rails in my ubuntu system(Ubuntu 10.04.3 LTS) using following commad gem install rails -v ">=3.1.0" When i am trying to install desk@desk-pc:~$ gem install rails -v ">=3.1.0" Successfully installed rails-3.0.3 1 gem installed Installing ri documentation for rails-