InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
What Is Mvc? And How It Works? |
|
Answer» MVC tends for MODEL-View-Controller, used by many languages like PHP, Perl, PYTHON etc. The flow goes like this: REQUEST first comes to the controller, controller finds and appropriate view and interacts with model, model interacts with your database and send the response to controller then controller BASED on the response give the output parameter to view. MVC tends for Model-View-Controller, used by many languages like PHP, Perl, Python etc. The flow goes like this: Request first comes to the controller, controller finds and appropriate view and interacts with model, model interacts with your database and send the response to controller then controller based on the response give the output parameter to view. |
|
| 52. |
What Are Helpers And How To Use Helpers In Ror? |
|
Answer» Helpers are modules that provide methods which are automatically usable in your VIEW. They provide SHORTCUTS to COMMONLY used display code and a WAY for you to keep the programming out of your views. The PURPOSE of a helper is to simplify the view. Helpers are modules that provide methods which are automatically usable in your view. They provide shortcuts to commonly used display code and a way for you to keep the programming out of your views. The purpose of a helper is to simplify the view. |
|
| 53. |
How Many Types Of Associations Relationships Does A Model Have? |
|
Answer» When you have more than one model in your rails application, you would need to create connection between those models. You can do this via associations. Active Record supports three TYPES of associations: one-to-one: A one-to-one RELATIONSHIP EXISTS when one item has exactly one of another item. For example, a person has exactly one BIRTHDAY or a dog has exactly one owner. one-to-many: A one-to-many relationship exists when a single object can be a member of many other objects. For instance, one subject can have many books. many-to-many: A many-to-many relationship exists when the first object is related to one or more of a SECOND object, and the second object is related to one or many of the first object. You indicate these associations by adding declarations to your models: has_one, has_many, belongs_to, and has_and_belongs_to_many. When you have more than one model in your rails application, you would need to create connection between those models. You can do this via associations. Active Record supports three types of associations: one-to-one: A one-to-one relationship exists when one item has exactly one of another item. For example, a person has exactly one birthday or a dog has exactly one owner. one-to-many: A one-to-many relationship exists when a single object can be a member of many other objects. For instance, one subject can have many books. many-to-many: A many-to-many relationship exists when the first object is related to one or more of a second object, and the second object is related to one or many of the first object. You indicate these associations by adding declarations to your models: has_one, has_many, belongs_to, and has_and_belongs_to_many. |
|
| 54. |
What Is Orm In Rails? |
|
Answer» ORM tends for Object-Relationship-Model, where Classes are MAPPED to table in the DATABASE, and OBJECTS are DIRECTLY mapped to the rows in the table. ORM tends for Object-Relationship-Model, where Classes are mapped to table in the database, and Objects are directly mapped to the rows in the table. |
|
| 55. |
What Do You Mean By Render And Redirect_to? |
|
Answer» render causes rails to generate a RESPONSE WHOSE CONTENT is provided by rendering one of your templates. Means, it will direct goes to view page. redirect_to generates a response that, instead of DELIVERING content to the browser, just tells it to request ANOTHER url. Means it first checks actions in controller and then goes to view page. render causes rails to generate a response whose content is provided by rendering one of your templates. Means, it will direct goes to view page. redirect_to generates a response that, instead of delivering content to the browser, just tells it to request another url. Means it first checks actions in controller and then goes to view page. |
|
| 56. |
Why Ruby On Rails? |
|
Answer» There are lot of advantages of using ruby on rails.
Plugins: A Rails plugin is either an extension or a modification of the core framework. It provides a way for developers to share bleeding-edge ideas without hurting the stable code base. We need to decide if our plugin will be potentially shared across different Rails applications. -STATIC: Static scaffolding takes 2 parameter i.e your controller NAME and model name. -dynamic: In dynamic scaffolding you have to define controller and model ONE by one. There are lot of advantages of using ruby on rails. Plugins: A Rails plugin is either an extension or a modification of the core framework. It provides a way for developers to share bleeding-edge ideas without hurting the stable code base. We need to decide if our plugin will be potentially shared across different Rails applications. -static: Static scaffolding takes 2 parameter i.e your controller name and model name. -dynamic: In dynamic scaffolding you have to define controller and model one by one. |
|
| 57. |
Explain About Restful Architecture? |
|
Answer» RESTful: REST STANDS for Representational State Transfer. REST is an architecture for designing both web applications and application programming interfaces (API’s), that’s uses HTTP. RESTful interface means clean URLs, less CODE, CRUD interface. CRUD means Create-READ-UPDATE-DESTROY. In REST, they add 2 NEW verbs, i.e, PUT, DELETE. RESTful: REST stands for Representational State Transfer. REST is an architecture for designing both web applications and application programming interfaces (API’s), that’s uses HTTP. RESTful interface means clean URLs, less code, CRUD interface. CRUD means Create-READ-UPDATE-DESTROY. In REST, they add 2 new verbs, i.e, PUT, DELETE. |
|
| 58. |
What Are The Various Components Of Rail? |
Answer»
Action Controller: Action Controller is the component that manages the controllers in a Rails application. The Action Controller framework processes incoming requests to a Rails application, extracts parameters, and DISPATCHES them to the intended action. Services provided by Action Controller include session management, template rendering, and redirect management. Action View: Action View manages the views of your Rails application. It can create both HTML and XML output by default. Action View manages rendering templates, including nested and partial templates, and includes built-in AJAX support. Action Dispatch: Action Dispatch handles routing of web requests and dispatches them as you want, either to your application or any other Rack application. Rack applications are a more advanced topic and are covered in a separate guide called Rails on Rack. Action Controller: Action Controller is the component that manages the controllers in a Rails application. The Action Controller framework processes incoming requests to a Rails application, extracts parameters, and dispatches them to the intended action. Services provided by Action Controller include session management, template rendering, and redirect management. Action View: Action View manages the views of your Rails application. It can create both HTML and XML output by default. Action View manages rendering templates, including nested and partial templates, and includes built-in AJAX support. Action Dispatch: Action Dispatch handles routing of web requests and dispatches them as you want, either to your application or any other Rack application. Rack applications are a more advanced topic and are covered in a separate guide called Rails on Rack. |
|