rajdeep wrote:> hello everybody, i am new to ROR i have some doubts
> 1> will u tell me that what Convention over configuration
> what i mean is which configurations are avoided and what conventions
> we use in ROR
>
> 2>DRY principle->dont repeat yourself whats it is exactly what kind
of
> repeations are avoided
>
> Thank u
1) Conventions like how to name your database tables. Every table has
an id column, and association foreign keys are the name of the
associated table + _id (i.e. product_id). Other things like the naming
of files. If you have a controller called ''Foo'' and an action
named
''bar'', then the view for that action will be in
/app/views/foo/bar.rhtml
These conventions allow you to link your app together with very little
explicit and repetitive code that describes those links. It just works
because the framework is intelligent enough to figure out what you want
to do because you are following a logical path.
2) Rails aims to get rid of the copy & paste style programming. Any
programming is prone to snippets of code that are close, or even the
same, but in different places of your code. Rails (and Ruby) make it
easy to abstract your logic into smaller and more reusable chunks.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---