i''m newbie in rails. i have problem with how to connect rails with database. before i can connect it with command "rake db:create" to create database. and "rake db:migrate" to migrate schema to database. but, i want to connect rails with database that i have before, not create it via rails. can you help me? -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Thu, Dec 13, 2012 at 10:54 AM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> i''m newbie in rails. i have problem with how to connect rails with > database. before i can connect it with command > "rake db:create" to create database. > and "rake db:migrate" to migrate schema to database.> but, i want to connect rails with database that i have before, not > create it via rails. can you help me? >just setup your config/database.yml and that should work. however, when you want to collaborate with someone, you have to depend on schema.rb rather than migrations to create the database.> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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://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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end create_table "bukus", :force => true do |t| t.string "isbn" t.string "judul" t.string "penulis" t.string "penerbit" t.string "kategori" t.integer "edisi" t.integer "jumlah" t.integer "jumlah_dipinjam" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end create_table "posts", :force => true do |t| t.string "name" t.string "title" t.text "content" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end end ---------------------------------------------------------- it say create_table "name of table", but the problem is i have been have that table in my database, and i didn''t want to change that table. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Thu, Dec 13, 2012 at 11:22 AM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 "alamat" > t.text "no_telp" > t.datetime "waktu_daftar" > t.datetime "created_at", :null => false > t.datetime "updated_at", :null => false > end > > create_table "bukus", :force => true do |t| > t.string "isbn" > t.string "judul" > t.string "penulis" > t.string "penerbit" > t.string "kategori" > t.integer "edisi" > t.integer "jumlah" > t.integer "jumlah_dipinjam" > t.datetime "created_at", :null => false > t.datetime "updated_at", :null => false > end > > create_table "posts", :force => true do |t| > t.string "name" > t.string "title" > t.text "content" > t.datetime "created_at", :null => false > t.datetime "updated_at", :null => false > end > > end > ---------------------------------------------------------- > > it say create_table "name of table", but the problem is i have been have > that table in my database, and i didn''t want to change that table. >first run rake db:schema:dump to generate your schema from the current database. Then if you want to run a scaffold (I''ve just tested this one, I don''t actually use scaffold), use rails g scaffold <singular_table_name> --migration false> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
i can''t understand this command "rails g scaffold <singular_table_name> --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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Thu, Dec 13, 2012 at 5:38 PM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> i can''t understand this command > "rails g scaffold <singular_table_name> --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 need to run rails g scaffold comment but that will generate a migration file for creating the table on the db. since you already have the tables, you can pass --migration false to skip creating the migration.> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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. Can I have a table named in the singular form, and run the command with the same name? I have tried, but it can not display the contents of my database. there are things that make me confused, it was formed six lines of command "show, edit, and destroy", an amount equal to the number of records in the table "member". but does not display the contents of the table "member" it. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Thu, Dec 13, 2012 at 11:22 PM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 begins with a capital > letter and using the singular form. Can I have a table named in the > singular form, and run the command with the same name? > > I have tried, but it can not display the contents of my database. there > are things that make me confused, it was formed six lines of command > "show, edit, and destroy", an amount equal to the number of records in > the table "member". but does not display the contents of the table > "member" it. >try looking for set_table_name syntax to set the table name that you want to use> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 14, 2012 at 9:33 AM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 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, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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_controller.rb:46:in `block in create'' app/controllers/anggota_controller.rb:45:in `create'' can you help me?? -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 14, 2012 at 9:58 AM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 MemberController#create" > > and this error > > app/controllers/anggota_controller.rb:46:in `block in create'' > app/controllers/anggota_controller.rb:45:in `create'' >can you post your code on anggota_controller?> > can you help me?? > > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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 show @anggotum = Anggotum.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @anggotum } end end # GET /anggota/new # GET /anggota/new.json def new @anggotum = Anggotum.new respond_to do |format| format.html # new.html.erb format.json { render json: @anggotum } end end # GET /anggota/1/edit def edit @anggotum = Anggotum.find(params[:id]) end # POST /anggota # POST /anggota.json def create @anggotum = Anggotum.new(params[:anggotum]) respond_to do |format| if @anggotum.save format.html { redirect_to @anggotum, notice: ''Anggotum was successfully created.'' } format.json { render json: @anggotum, status: :created, location: @anggotum } else format.html { render action: "new" } format.json { render json: @anggotum.errors, status: :unprocessable_entity } end end end # PUT /anggota/1 # PUT /anggota/1.json def update @anggotum = Anggotum.find(params[:id]) respond_to do |format| if @anggotum.update_attributes(params[:anggotum]) format.html { redirect_to @anggotum, notice: ''Anggotum was successfully updated.'' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @anggotum.errors, status: :unprocessable_entity } end end end # DELETE /anggota/1 # DELETE /anggota/1.json def destroy @anggotum = Anggotum.find(params[:id]) @anggotum.destroy respond_to do |format| format.html { redirect_to anggota_url } format.json { head :no_content } end end end ------------------------------------------------------------- that the code of anggota_controller.rb ----------------------------------------- -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 14, 2012 at 10:14 AM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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: @anggota } > end > end > > # GET /anggota/1 > # GET /anggota/1.json > def show > @anggotum = Anggotum.find(params[:id]) > > respond_to do |format| > format.html # show.html.erb > format.json { render json: @anggotum } > end > end > > # GET /anggota/new > # GET /anggota/new.json > def new > @anggotum = Anggotum.new > > respond_to do |format| > format.html # new.html.erb > format.json { render json: @anggotum } > end > end > > # GET /anggota/1/edit > def edit > @anggotum = Anggotum.find(params[:id]) > end > > # POST /anggota > # POST /anggota.json > def create > @anggotum = Anggotum.new(params[:anggotum]) > > respond_to do |format| > if @anggotum.save > format.html { redirect_to @anggotum, notice: ''Anggotum was > successfully created.'' } > format.json { render json: @anggotum, status: :created, > location: @anggotum } > else > format.html { render action: "new" } > format.json { render json: @anggotum.errors, status: > :unprocessable_entity } > end > end > end > > # PUT /anggota/1 > # PUT /anggota/1.json > def update > @anggotum = Anggotum.find(params[:id]) > > respond_to do |format| > if @anggotum.update_attributes(params[:anggotum]) > format.html { redirect_to @anggotum, notice: ''Anggotum was > successfully updated.'' } > format.json { head :no_content } > else > format.html { render action: "edit" } > format.json { render json: @anggotum.errors, status: > :unprocessable_entity } > end > end > end > > # DELETE /anggota/1 > # DELETE /anggota/1.json > def destroy > @anggotum = Anggotum.find(params[:id]) > @anggotum.destroy > > respond_to do |format| > format.html { redirect_to anggota_url } > format.json { head :no_content } > end > end > end > > ------------------------------------------------------------- > > that the code of anggota_controller.rb > ----------------------------------------- >Where do you use the member table? I think you need to read on the MVC architecture first before you start working on this one. I really can''t help you if you have no firsthand knowledge of how the models and controllers are connected.> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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 Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 14, 2012 at 10:24 AM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 Anggota model. If you''re doing that and still gets errors, I don''t know what your issue is. I can''t see any errors on your controller. It seems like it''s the one generated by the scaffold generator so there shouldn''t be any errors in there. Try running the console and see if Anggota.first retrieves the first record.> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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 --------------------------------------- i have try to make new rails app, and that is the step by step that i did. did i do wrong step?? -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 14, 2012 at 11:41 AM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 Anggotum < ActiveRecord::Base > set_table_name "anggota" > end > --------------------------------------- > > i have try to make new rails app, and that is the step by step that i > did. > did i do wrong step?? >everything looks ok. did you try it on the console?> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
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 to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 14, 2012 at 2:10 PM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 and learn the basics of rails. I suggest looking at the rails guide for starters.> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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 in table. -- 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 14, 2012 at 6:16 PM, Mas Bejo <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 run this command: > > "Anggotum.all" > > it can show all of my record in table. >congrats! you''re able to connect to the database. if you have other errors, please open a new thread about it :)> > -- > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.