Board » Webapp Framework Comparison » Logs » Ruby On Rails

Page: Previous 1 2 3

waaa.. it always uses the beer_id also for id:

mysql> select * from bars_beers;
+----+--------+---------+
| id | bar_id | beer_id |
+----+--------+---------+
|  1 |      3 |       1 | 
|  2 |      2 |       2 | 
|  3 |      2 |       3 | 
|  4 |      2 |       4 | 
|  5 |      2 |       5 | 
|  6 |      1 |       6 | 
+----+--------+---------+
6 rows in set (0.00 sec)


i can't add the same beer to more than one bar.. that is not really what i meant with ... many-to-many ..
Hey, we have Signatures !!! Great, isn't it ? ;)
well.. i actually have no idea what i did wrong .. i will simply drop the table and recreate it by hand.. i don't want to play around with migration files any more ... it's getting boring ..
Hey, we have Signatures !!! Great, isn't it ? ;)
mysql> drop table bars_beers;
Query OK, 0 rows affected (0.00 sec)

mysql> create table bars_beers (bar_id integer not null references bars (id), beer_id integer not null references beer (id), primary key (bar_id, beer_id));
Query OK, 0 rows affected (0.00 sec)
Hey, we have Signatures !!! Great, isn't it ? ;)
better .. it works now :)
Hey, we have Signatures !!! Great, isn't it ? ;)
ok .. i'll now give authentication a try ...
http://wiki.rubyonrails.com/rails/pages/Acts_as_authenticated
Hey, we have Signatures !!! Great, isn't it ? ;)
ok .. the documentation says:

Yay! (read why)

You've (probably) come to the right place. acts_as_authenticated seems to be the only sane solution if you're looking for an authentication system generator for rails. Rejoice and use it!


during one of those commands:

DEPRECATED: Use restful_authentication instead. Or, ask me for commit rights if you wish to maintain this plugin.


anyway .. i believe the documentation for now :) since i have no desire to look any further..
Hey, we have Signatures !!! Great, isn't it ? ;)
ok, i'm almost there now .. adding comments ...
Hey, we have Signatures !!! Great, isn't it ? ;)
migration file i came up with:

class Comments < ActiveRecord::Migration
  def self.up
    create_table :comments do |table|
      table.column :bar_id, :integer
      table.column :user_id, :integer
      table.column :postdate, :timestamp
      table.column :body, :text
    end
  end

  def self.down
    drop_table :comments
  end
end
Hey, we have Signatures !!! Great, isn't it ? ;)
ok.. comments are working ..
Hey, we have Signatures !!! Great, isn't it ? ;)
ok... i think ..


i'm done... (although i'm not really satisfied with the results)
Hey, we have Signatures !!! Great, isn't it ? ;)

Page: Previous 1 2 3

Please login to post a reply.

Personal website and blog of Herbert Poul. Also check out my Photo Gallery.




Herby's Photo Gallery

Subscriptions

User

You are not logged in.
Login
Register