similar to: ruby script / console and models

Displaying 20 results from an estimated 20000 matches similar to: "ruby script / console and models"

2006 Jun 09
18
Is IRB the ruby console ?
I''m running script/console but keep getting the message that irb.bat is not recognized as an internal or external command, operable program or batch file. If it means anything I am running instant rails. I can invoke irb straight forward. TIA Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jun 08
19
Agile Web Dev (book) question: errors
This is kind of frustrating (but no doubt helpful in the long run) that after following along and coding , and d/l the code the same error is appearing. For those who are familiar with the depot app, I''ve run into a problem after fixing the cart to reflect quanitites. I worked through the intended error messages but now have this appearing: SyntaxError in StoreController#add_to_cart
2006 Jun 13
11
Question: Migration - multiple creates
I want to create a migration file that creates multiple tables, so i''m guessing the correct format would be: Can anyone confirm ? I''m guessing that each new create script requires a seperate class so formatted this way. Perhaps I''m wrong. TIA Stuart class CreateTable1 < ActiveRecord::Migration def self.up create_table :table1s do |t| t.column :length,
2006 Jun 08
1
Test errors
I''m working on learning user auth and ran a test/unit/test.rb and seem to have stumbled across some errors. This is from a tutorial on the web and I pretty much copied the code and checked syntax so not sure where it''s wrong. I thought I''d throw it out since I"m new to ROR and the error didn''t look too bad ;), perhaps someone would have a better
2006 Aug 11
9
Getting Really Started with Rails - Tutorial styled Slides Available
For those that missed out joining the amazing turnout of ~70 people here in Vancouver for the mini-workshop I did on the 27th last month, I am making available the 30 slides I used for the presentation. The slides were used in conjunction with me demonstrating it via command line. Alot was learned by both attendees, and quite possibly even more so by myself while teaching the material. I created
2006 Jul 21
8
Ruby on Rails Impossible Windows
Hello, Ruby on Rails still, as I think, very poor with MS Windows. I make the comparison as a PHP user. In some minutes, I have got Apache running PHP easily. In Ruby On Rails, there is no such breeze. I expect in the future, Ruby on Rails is going to offer something like php4apache.dll to make life easier. As I think, There are three things made PHP popular: 1st, The ease of installation 2nd,
2006 Aug 09
3
Need help with backgroundrb''s concepts and installation
Hello backgroundrb-devel my name is Teeranit Ruangdet. I''m fairly new to Ruby on Rails so please bear with me here. I''m currently on a project where I need to import a whole bunch of records from spreadsheet(.csv) and save them in the database. My problem is that while I''m importing (huge file...say 5000 employees), no one else can access the website (it basically block
2008 Jan 15
2
Installing Ruby on Rails - missing the "Components" folder.
Hi, I''m trying to get up and running on rails. I''m on Vista 32 and have installed instant rails on C:\InstantRails from: http://instantrails.rubyforge.org/wiki/wiki.pl I''ve done the "gem update --system" and "gem install rails --include- dependencies" When I run the "rails music_library" command from rails_apps directory I get the default
2006 Jun 06
15
error working through Agile !!!
Hi everyone, I''m working my way thru the ''Depot'' project from Agile Web Development with Rails. I got to the bit where I type: ruby script/generate scaffold Product admin And I get the following error: error Before updating scaffolding from new DB schema, try creating a table for your model (Product) ( on the last line ! ) Now I have followed everything as
2006 Aug 14
1
Calling a method in console
I''m using the Ruby for Rails book and have all the code done and application works. However I''d like to access some of the methods through script/console. For example in the edition model file (below) I''d like to know how to call either the "Edition_of_Works" or composers methods: class Edition < ActiveRecord::Base has_and_belongs_to_many :works
2006 Aug 07
8
Login form question
I''m using Rails Recipes to create a login form but instead of username and password, my setup is firstname, lastname, password. I seemed to be gramatically challenged and not sure how to set up the parameter list. Can anyone offer up a suggestion. The book shows the method starting like: if request.post? user = User.find(:first, :conditions => [''username = ?'' ,
2010 Aug 24
11
will_paginate problem
Hi I am using rails 2.3.8 & ruby 1.3.7 & will_paginate 2.3.14 I have table name books. I am doing this code for pagination, In book_controller @@@@books = Book.paginate :page => params[:page], :per_page => 10@@@@ & in index.html.erb @@@@@<%= will_paginate @books %>@@@@@ Also added in environment.rb file this line @@@@@ require
2006 Jun 18
13
Currency calculation
I''m thinking of experimenting with some currency conversion. However, I''d like the conversions to be in synch with the current rates. Anyone know (and this maybe out in left field) if there is some online (perhaps xml) or other data stream I can connect with in my code to output values based on user selection ? TIA Stuart
2006 May 09
6
Still Stumbled on First things in trying RubyOnRails
Still Stumbled on First things in trying RubyOnRails http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html http://instantrails.rubyforge.org/tutorial/index.html http://rails.homelinux.org/ I had tried the first of the top 12 tutorials and got stuck after adding a new field ?category_id?in the table recipes,
2006 Jun 14
13
Undefined method
I really hope this is not a bad question (as in he''s abusing the list). However I could use a little direction (even though I''m reading books, tutorials) Right now I''m getting a undefined method `category'' for 4:Fixnum The specific lines from the rhtml file are: <td><%= link_to position.category_id.category, :action => "show", :id =>
2006 Jun 17
4
Simple tutorial weirdness
Sorry - working on a simple tutorial but something is throwing me here. I''m supposed to get a Time.now() print to the page but it''s not working and I can''t figure out why. No errors are thrown my the page shows: Howdy, world! My name is Stuart Felenstein. This was verified at . So no time stamp showing. I went into IRB , did a Time.now() and it''s working
2007 Feb 04
4
problems with tutorial
I''m having some trouble with the instructions at the link below: http://instantrails.rubyforge.org/tutorial/restarting_the_dev_env.html I had started at the tutorial at http://instantrails.rubyforge.org/ tutorial/index.html and had gotten as far as creating the cookbook2 exercise and had gotten to the "Welcome aboard you''re riding ruby rails" screen in explorer, but
2006 Aug 08
11
Newb question- method not working
I know this shouldn''t be in the view but to test the code it is. Anyway if I do just session[user] I get back the user id (the id from the user table) which is good. However this code does not work. <% a = session[:user] %> <% uname = User.find(:first, :conditions => id = a) %> <%= @uname %> TIA Stuart
2006 Jun 23
16
Help please-draggable
I asked the other day about this problem but haven''t received a response. Trying again: I just downloaded 1.6 and can''t get a simple draggable to work, which is weird. I know it''s not my browser since the demos are working. Here is my simple code. I''ve also had the "new Draggable" between the select tags. Didn''t change anything.
2006 Jun 19
12
AWDWR- Question
I''m having a particularly difficult time undersanding one lesson from this book. This is in relation ot how one would grab "search" parameters from web forms to search for records in the database. I understand the :conditions part of find() but am confused on the code: 1- name = params[:name] pos = Order.find(:all, :conditions => ["name = ? and pay_type =