Capistrano:
The basic Application Flow:
When a http request comes first it hits the routes.rb file.There based on the routing of the resources you give the control leads to the page that is pointed to by the "root :to" field.Then first it strikes the controller and the specific action.Once the action is completed it goes to the specific html page in the views.To display new.html first new is executed,if the object is created in new then it invokes the "create" method after the execution of new.html.erb of that model on "submit".If it is a retrieved item then it triggers the" update "action in the controller.
If you want to have full control with the flow you can redirect the application flow using "redirect_to " and "render".render doesnt invoke the controller and the model.It just renders the view."redirect_to" creates a http req goes through the model and the controller and with the result renders the view page.
Evolving your Database:1)Create the model 2)Create a database rake db:create 3)give rake db:migrate 4)make migrations and keep repeating the step 3 for each change to update.
- This is an open source tool for running scripts on multiple server.
- Supports changing of databases quickly.
- Written in ruby language and is distributed as rubygems .
- It executes command on parallel on multiple systems via the SSH.
- Capistrano was originally designed to simplify and automate deployment of web applications to distributed environments.
- It can also deploy web applications that are even written in other languages like php etc though written in ruby.
- >install gem capistrano is the command to install the gem.
Named Routes:
These are used to provide name to the routes ,so that it is more easily accessible and recognised.An eg goes like this,
match "users/prof/new" => prof#new ,:as=>"routee".
Now if we have to access that particular page in the link give it as
link_to goooo routeee_path..
Install gems in a better way:
Now as i was telling abt the various gems in ruby I told the method of installing gems as sudo install the gem_name.But that is not the best method.There will be some clashes based on the versions of ruby and the various gems versions.The better method and the one to be followed is to give the "gem "devise" in the Gemfile and then in the terminal give "bundle install"
Nginix Applications:
->Kind of web server
->Manages Http requests,allows concurrent access.
->Follows event driven approach rather than the thread driven approach and supports multiple instances of the same application
->other eg)Apache tomcat which we commonly use.
Passenger:
The most commonly used application servers are Thin, Passenger and Mongrel.
It is a very powerful application server which is robust.It handles the request sent by the web server effectively.
Passenger is what is easy to configure and is recommended by rails.
The basic Application Flow:
When a http request comes first it hits the routes.rb file.There based on the routing of the resources you give the control leads to the page that is pointed to by the "root :to" field.Then first it strikes the controller and the specific action.Once the action is completed it goes to the specific html page in the views.To display new.html first new is executed,if the object is created in new then it invokes the "create" method after the execution of new.html.erb of that model on "submit".If it is a retrieved item then it triggers the" update "action in the controller.
If you want to have full control with the flow you can redirect the application flow using "redirect_to " and "render".render doesnt invoke the controller and the model.It just renders the view."redirect_to" creates a http req goes through the model and the controller and with the result renders the view page.
Evolving your Database:1)Create the model 2)Create a database rake db:create 3)give rake db:migrate 4)make migrations and keep repeating the step 3 for each change to update.
No comments:
Post a Comment