Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7853755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:47:35+00:00 2026-06-02T19:47:35+00:00

I have previously created localhost-only RoR applications where models were created manually with scaffolds

  • 0

I have previously created localhost-only RoR applications where models were created manually with scaffolds generated for them, creating a nice, quick, easy to use CRUD interface for the data. I did this in Netbeans using SQLite.

Now I have a server with a MySQL database and wish to create a quick CRUD application which provides a quick and easy way to view data in the database and give a few options like edit/delete. As my database is already specified by MySQL this seems to open up a massive can of worms, making this a lot less straight forward in comparison to my Netbeans venture into scaffold-generated crud web apps in RoR.

I have looked into dumping the schema of my current database, db:raking it, then generating the scaffolds. Is this the correct approach? I have also read about Magic Model Generator. Is this the best way to go about getting the MySQL database to a RoR model format? http://magicmodels.rubyforge.org/magic_model_generator/

I guess what I’m asking is, for my database structure, is RoR appropriate to mock-up a quick CRUD web app so that the data can have basic manipulation performed on it?

Below is the schema.rb for my MySQL database. There is a FK relationship on userId and attachmentId.

ActiveRecord::Schema.define(:version => 0) do

  create_table "attachments", :primary_key => "attachmentId", :force => true do |t|
    t.string "attachmentName",               :null => false
    t.string "fileType",       :limit => 30, :null => false
    t.binary "content",                      :null => false
    t.string "printCode"
  end

  create_table "emails", :primary_key => "emailId", :force => true do |t|
    t.integer "userId",       :limit => 11,   :null => false
    t.integer "attachmentId", :limit => 11,   :null => false
    t.string  "body",         :limit => 1000
    t.string  "subject"
  end

  add_index "emails", ["attachmentId"], :name => "attachmentId", :unique => true
  add_index "emails", ["userId"], :name => "userId"

  create_table "printUsers", :primary_key => "userId", :force => true do |t|
    t.string "email", :null => false
  end

  add_index "printUsers", ["email"], :name => "email", :unique => true

end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:47:36+00:00Added an answer on June 2, 2026 at 7:47 pm

    There seem to be several approaches to using rails with an existing database. See Connect rails to existing postgres DB – models not seen by console and controllers, and especially the links from it: http://magicmodels.rubyforge.org/magic_model_generator/ and http://blog.aizatto.com/2007/05/21/activerecord-without-rails/

    It’s good to point out that you don’t need to use ActiveRecord with rails. Your model can be any Object, so it might be easier to use something like sequel or arel to access the data.

    Another approach would be to migrate the data out of your existing database and into a new one that you generate by scaffolding your models.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I am using Wireshark looking at captures that have been created previously. How
I have created a visual web part that combines two other previously created web
I have previously created a labyrinth game which works with Firefox's MozOrientation. I am
I have a Drupal installation that previously worked perfectly on my localhost. However, now,
I have previously only had simple scenarios where I have branched from trunk, made
I have to call a previously created function on SQL, like SET @ExtVALUE =
I have been creating PHP projects for years, and have previously written Database classes,
I have previously written user interfaces using .NET and Windows Forms. I'm about to
I have previously read Spolsky's article on character-encoding, as well as this from dive
I have previously been told that I should always use Randomize() before I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.