Having trouble getting started with Ruby on Rails -
I am thinking that someone can solve some issues I have? I create a Rail app:
Rail myapp -d mysql CD Meal Hamal - Rylus Rake db: create: all
Then I create tables I want to use a mysql client. Let's ask the users and customers that a customer is also a user so that you have such a schema:
user ---------------- id int, tap Primary key, auto increment first_name varchar (50) null last_name varchar (50) zero email varchar (50) no empty unique password varchar (50) zero not created dat daytime time not updated_at datetime no nulled customers ---- -------
Do the tracks require me to run the script command El-made models, views and controllers under the app and be completely filled? I tried to do this:
Ruby Script / Scrofold User Generates Ruby Script / Generates Clown Customers
which creates files but models are empty :
class users & lt; ActiveRecord :: Base End
What's the deal? In addition, I want to make an administration section to manage goods. I have found out that I need to add routes for this:
map.namespace: admin do | Admin | Admin.resources: User admin.resources: End of Customer
What more do I need to go to the Administration section? Here are the versions of Ruby / Gems that I am running:
Ruby 1.8.6 Rail 2.3.5 & amp; 2.3.2 & lt; - I'm using 2.3.2 because haml was not working with haml 2.2.15 rspec 1.2.9 (or any other plugin) - I saw from another thread that I might need it When creating an admin section (rspec_controler etc)
The model should be empty by default Because the database schema is saved in the schema.rb
file and managed by using it.
By your reply, I understand that you are looking for a prepay solution to write some configurations and get everything from the controller to the cooked administration for you. I'm sorry, Rail does not offer you this facility.
- Create your own ideas and templates
- Create your own tasks
- If you want an administration section, you have to code it.
- Mapping your routes
- Write your tests
Scaffold provides only you a starting point, but this is a starting point that you can customize and Needed should expand.
If you want Scaffolding your initial scenes according to your database table, you can pass the arguments in the command line tool
Ruby script / pub username Generate: String Age: Integer
But if you want to add a new area later, then you have to write a new migration and accordingly you have to edit your thoughts / actions accordingly.
More information is available in Rail.
Comments
Post a Comment