[Rails] Re: make rails connect with database

2012-12-14 Thread Mas Bejo
thanks for your help. i know what the problem. i forgot to add syntax to show it, because usually it make automaticly. thanks for your help. -- 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

Re: [Rails] Re: make rails connect with database

2012-12-14 Thread Jim Ruther Nill
On Fri, Dec 14, 2012 at 6:16 PM, Mas Bejo wrote: > owh, i see.. i forgot that command. i have been try that command in > other app (but when i create database via rails), but i forgot to try > this command in this app. > > > so, this the step, i try to run this: > > "rails console" > > and then i

[Rails] Re: make rails connect with database

2012-12-14 Thread Mas Bejo
owh, i see.. i forgot that command. i have been try that command in other app (but when i create database via rails), but i forgot to try this command in this app. so, this the step, i try to run this: "rails console" and then i run this command: "Anggotum.all" it can show all of my record

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Fri, Dec 14, 2012 at 2:10 PM, Mas Bejo wrote: > i didn't understand your instruction. what must i run in console? did > you mean "rails server"? or what else? > i mean rails console. http://guides.rubyonrails.org/command_line.html#rails-console you really need to go through a tutorial first

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
i didn't understand your instruction. what must i run in console? did you mean "rails server"? or what else? -- 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 this group, send email t

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Fri, Dec 14, 2012 at 11:41 AM, Mas Bejo wrote: > 1. Rails new First_app > 2. Change config database.yml > 3. Rake db:schema:dump > 4. Rails g scaffold Anggota –migration false > 5. Change First_app\app\model\anggotum.rb with this syntax > > - > class A

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
1. Rails new First_app 2. Change config database.yml 3. Rake db:schema:dump 4. Rails g scaffold Anggota –migration false 5. Change First_app\app\model\anggotum.rb with this syntax - class Anggotum < ActiveRecord::Base set_table_name "anggota" end ---

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Fri, Dec 14, 2012 at 10:24 AM, Mas Bejo wrote: > no, i didn't use member table, i use member word just to describe to you > singular and plural form. because i little confuse tell you plural form > from word "anggota" > ok. Just make sure that you're using the table name on the db on the Ang

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
no, i didn't use member table, i use member word just to describe to you singular and plural form. because i little confuse tell you plural form from word "anggota" -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Fri, Dec 14, 2012 at 10:14 AM, Mas Bejo wrote: > class AnggotaController < ApplicationController > # GET /anggota > # GET /anggota.json > def index > @anggota = Anggotum.all > > respond_to do |format| > format.html # index.html.erb > format.json { render json: @anggot

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
class AnggotaController < ApplicationController # GET /anggota # GET /anggota.json def index @anggota = Anggotum.all respond_to do |format| format.html # index.html.erb format.json { render json: @anggota } end end # GET /anggota/1 # GET /anggota/1.json def s

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Fri, Dec 14, 2012 at 9:58 AM, Mas Bejo wrote: > i try to add this syntax > > set_table_name "member" > > in member.rb at folder app\models\ > > but same as before it can't show record in table member, and i try to > click new member, i saw this error > > "ActiveRecord::StatementInvalid in Memb

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
i try to add this syntax set_table_name "member" in member.rb at folder app\models\ but same as before it can't show record in table member, and i try to click new member, i saw this error "ActiveRecord::StatementInvalid in MemberController#create" and this error app/controllers/anggota_cont

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Fri, Dec 14, 2012 at 9:33 AM, Mas Bejo wrote: > did you mean add this syntax > > set_table_name "member" > > in app\models\member.rb?? > > i have been try it, but it didn't work.. > well just saying it didn't work won't help you at all. describe what happens and why you concluded it didn't

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
did you mean add this syntax set_table_name "member" in app\models\member.rb?? i have been try it, but it didn't work.. -- 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 this group

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Thu, Dec 13, 2012 at 11:22 PM, Mas Bejo wrote: > I always see, every table in rails given the name of the plural form. > however I have a table with a singular form. let say my table name > "member" not "members", could this create problems? > then the rails command writing table name usually

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
I always see, every table in rails given the name of the plural form. however I have a table with a singular form. let say my table name "member" not "members", could this create problems? then the rails command writing table name usually begins with a capital letter and using the singular form.

Re: [Rails] Re: make rails connect with database

2012-12-13 Thread Jim Ruther Nill
On Thu, Dec 13, 2012 at 5:38 PM, Mas Bejo wrote: > i can't understand this command > "rails g scaffold --migration false" > > can you describe it more? > if you have a table called comments in your current database, and you want to generate the model, controller and views for that table, you ne

[Rails] Re: make rails connect with database

2012-12-13 Thread Mas Bejo
i can't understand this command "rails g scaffold --migration false" can you describe it more? -- 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 this group, send email to rubyonrails-

Re: [Rails] Re: make rails connect with database

2012-12-12 Thread Jim Ruther Nill
On Thu, Dec 13, 2012 at 11:22 AM, Mas Bejo wrote: > i try open schema.rb, and i saw this code > > ActiveRecord::Schema.define(:version => 20121201063411) do > > create_table "anggota", :force => true do |t| > t.string "nama" > t.text

[Rails] Re: make rails connect with database

2012-12-12 Thread Mas Bejo
i try open schema.rb, and i saw this code ActiveRecord::Schema.define(:version => 20121201063411) do create_table "anggota", :force => true do |t| t.string "nama" t.text "alamat" t.text "no_telp" t.datetime "waktu_daftar"

[Rails] Re: make rails connect with database

2012-12-12 Thread Mas Bejo
i have been setup database.yml, with same name database that i want to use. but then what i should do? Should i to run "rails generate scaffold"? let say my command "rails generate scaffold members name:string email:string" to create schema?? and then run "rake db:migrate"? -- Posted via http:/