Displaying 20 results from an estimated 10000 matches similar to: "wrong number of arguments (Wrox Beginning Ruby On Rails)"
2006 Mar 15
10
Scaffold with Foreign Key
I have two tables:
------------------------------
drop table if exists users;
create table users (
id int not null auto_increment,
username varchar(100) not null,
password varchar(20) not null,
firstname varchar(20) not null,
lastname varchar(20) not null,
primary key (id)
) TYPE = InnoDB;
------------------------------
drop table
2006 May 04
9
Help: wrong number of arguments (0 for 1)
Is it my environment? Is something wrong, cause I thought this should
just work?
I have a simple table and I created a model and a controller:
ruby script/generate controller Restaurant
ruby script/generate model Restaurant
I edited the controller to this:
class RestaurantController < ApplicationController
scaffold :Restaurant
end
I run it and:
http://0.0.0.0:3000/Restaurant works fine,
2009 Jul 04
3
scaffolding
hi , i used the folllwing command to scaffold,
G:\my\webblog>ruby script/generate scaffold webblog id:integer
title:string body
:text created_at:datetime
after when i migrate with the follwing command
rake db:migrate
i got the error as
(in G:/my/webblog)
== 1 CreateWebblogs: migrating
================================================
-- create_table(:webblogs)
rake aborted!
Mysql::Error:
2006 Jul 04
1
LoginGenerator Problem
I am trying to make a barebones login system based on this example
(which in turn is just standard RoR login) but when I enter a user name
and password, it says the login is unsuccessful every time. I am not
sure where I am going wrong. Here is all relevent information
CREATE TABLE `users` (
`id` int(6) unsigned NOT NULL auto_increment,
`login` varchar(20) NOT NULL default
2006 May 04
6
Login generator ALWAYS says login unseccesfull
Hey I just ran this "ruby script/generate login loging_in" here is my
SQL:
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`user_name` varchar(80) default NULL,
`login` varchar(120) NOT NULL default '''',
`last_update` timestamp NOT NULL default ''0000-00-00 00:00:00'',
`last_attack` timestamp NOT NULL default ''0000-00-00
2007 Apr 02
19
Pref for beginner book: Wrox (Holzner) or Ruby for Rails?
I''m a beginner. I''ve done the apple tutorial, Agile ROR (the depot
app, I stopped after that, a little to advanced with no base knowledge
of Ruby), Why''s guide and my copy of Chris Pine''s book today. After
Pine, I''m going to buy either the Wrox book or Ruby for Rails book. I
did a search and there''s not too much on the Wrox book (Holzner)
2005 Dec 27
2
NoMethodError in new scaffold
Hi All,
I created a new rails application using rails 1.0. I used "ruby
script\generate scaffold" for each of my tables. This worked on all but
2 of my tables. When I go to the new or edit action of my requests or
admins table, I get the error below.
On one table called admins I hadn''t followed the correct naming
convention and wasn''t able to edit or create
2006 May 14
3
Strange Database Mapping Question
Dear Rails List,
I am new on the list so will assume straight away that this question has been
answered before. As I can see no immediate way of searching the list, I will
ask the question. I apologize in advance for any disruption this may cause.
Question time:
I am trying to write a web application for the staff at my office to play a
form of virtual Super14. Its a bit like any of the
2006 Jan 03
6
Am I going too far or Rails is just confusing? was {validates_presence_of *_id attributes}
Thanks for the input Blair Zajac and Chris (Nolan and Hall), and for others.
If all of you have time, please follow this (the question still
relates to the previous posts by me):
I have provided full steps to reproduce the symptoms.
If it matters, I''m running Ruby 1.8.2, Rails 1.0, and MySQL 5.0.15 on
Windows XP Professional.
1. First, the setup
MySQL
-----
create database testdb;
2006 Mar 04
5
has_many and belongs_to example?
Hi!
If i have 2 tables i.e. product and images and product has_many images,
image belongs_to product - how to create _form.rhtml, new/create and
edit/update methods in product controller, so in a single form i can add
one product and MANY (let''s assume for now that this number is fixed)
images for this product?
Pleeeeease help me :)
--
Posted via http://www.ruby-forum.com/.
2009 Aug 31
3
Migration - wrong SQL statement is created
Hi,
I am doing my first steps with RoR and I have the following problem:
I execute my migration file with the following content on a
MySQL-database via Rake:
<code>
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.integer :id
t.string :username, :size => 100
t.string :password, :size => 100
t.string :email, :size
2006 Jul 02
5
Question about setting field values for a belongs_to model
I have two tables, applicants, and skills where each applicant
"has_many" skills, and each skill "belongs_to" an applicant.
When I have a reference to an applicant and a (skill) id for one of
their skills, I thought to update their skills by using
@applicant.skills.find(id_of_skill).description = ''new description''
# even adding
2006 Aug 17
6
NameError in AdminController#index building scaffold
I''m a pretty big newbie with ROR, but when following a tutorial I
encounter an ugly error when building a scaffold. Here is my
environment
Dev system:
- Windows XP
- java version "1.5.0_06"
- MySQL java version "1.5.0_06"
- Ruby 1.8.4
- Ruby Gems 0.9.0
- Gem install mysql
Successfully installed mysql-2.7.1-mswin32
Installing ri documentation for
2006 Sep 29
1
newbie Q: it won't display foreign keys...
I have two tables
CREATE TABLE continents (
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE countries (
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL,
continent_id int(11) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I generate scaffolds for country and for
2010 Aug 08
1
help me
i am creating an aplication where table name albums width attributes
CREATE TABLE albums ( id int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL default '''',
artist_old varchar(255) NOT NULL default '''',
release_date datetime NOT NULL default ''0000-00-00 00:00:00'',
genre varchar(50) NOT NULL default '''',
created_at
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
I''m working on a simple CMS. The main data type are "listings" a listing
habtm (has_and_belongs_to_many) categories and subcategories.
Subcategories belong_to categories. Subcategories are basically the same
as categories, but they are treated differently in a few situations.
The problem is, I can''t seem to write the view/controller/model code
that allows me to
2007 Dec 27
17
2.0 & "Agile Web Dev..." book
Just running through the first little project (depot) in ''Agile Web
Development with Rails''. It isn''t scaffolding like it says it should
in the book.
After running:
>rails -d mysql depot
then SQLing:
drop table if exists products;
create table products (
id int not null auto_increment,
title varchar(100) not null,
description text not null,
image_url varchar(200)
2010 Jan 30
1
Scaffold in Aptana error - wrong number of arguments(1 for 2) help?
Hi all - I''m new to rails and programming in general.
I installed Rails 2.3.5, using mac os x 10.5.8, running into problems
using scaffold. I am using Aptana Radrails as my IDE. I was not
encountering this problem when using Rails 1.2.6, which is odd because
from what I can gather online the entry syntax I am using should only
work with Rails 2.x . Any help would be greatly appreciated.
2006 Jan 04
8
Trying to display data from two tables
Alrighty folks, I''m really trying here, and want to succeed with Ruby on
Rails.
I''m trying to display data that is linked from two tables using the
Active Record naming conventions, as described in Agile Web book.
The stripped-down basics;
Database
drop table if exists people;
CREATE TABLE `people` (
`id` int(6) NOT NULL auto_increment,
`lastname` varchar(30) NOT NULL,
2006 Mar 28
11
ActionWebService date casting error
I have defined a web service to return information from a database as follows.
class BackendApi < ActionWebService::API::Base
api_method :find_all_vobs,
:returns => [[:int]]
api_method :find_vob_by_id,
:expects => [:int],
:returns => [Vob]
class BackendController < ApplicationController
wsdl_service_name ''Backend''