| Author |
Message |
Topic: acts_as_list usage |
s.nagesh
Replies: 0
Views: 41
|
: Advanced programming Posted: Thu Jul 01, 2010 9:15 am Subject: acts_as_list usage |
Hi all,
acts_as_list is one of the predefined function available in active Record. It will Gives child data lists-like behavior.
Parent will be able to traverse child data, move it around and ... |
Topic: Converting strng into date |
s.nagesh
Replies: 1
Views: 30
|
: A little Ruby programming (Basic programming in RoR) Posted: Thu Jul 01, 2010 3:03 am Subject: Converting strng into date |
Using Date.parse method you can convert string into date format.
syntax :
require 'date'
Date.parse ("21-july-2010") |
Topic: singleton methods and singleton class |
s.nagesh
Replies: 0
Views: 70
|
: A little Ruby programming (Basic programming in RoR) Posted: Thu Jun 24, 2010 12:24 pm Subject: singleton methods and singleton class |
Hi,
The methods are which are in singleton class is called singleton methods. The singleton class is also called as object-specific classes, anonymous classes, and virtual classes. Mostly it is c ... |
Topic: finding Cartesian product in Ruby |
s.nagesh
Replies: 0
Views: 70
|
: Advanced programming Posted: Tue Jun 22, 2010 4:29 am Subject: finding Cartesian product in Ruby |
Hi,
By using the following code we can generate Cartesian product of 2 arrays.
def cartesian(*args)
final_output= [[]]
... |
Topic: 1+N problem with associations |
s.nagesh
Replies: 0
Views: 52
|
: Advanced programming Posted: Tue Jun 22, 2010 3:12 am Subject: 1+N problem with associations |
Hi ,
While using associations will reduce lot of code and we can prevent the writing database related queries in views. But while using associations we will have a problem called 1+N. The associ ... |
Topic: Writing conditions in callbacks |
s.nagesh
Replies: 1
Views: 57
|
: Advanced programming Posted: Mon Jun 21, 2010 6:51 am Subject: Writing conditions in callbacks |
You can write like this
before_save :update_information, :if => :enabled, :unless => "<some condition>"
Thanks |
Topic: "Having" attribute in find method |
s.nagesh
Replies: 0
Views: 64
|
: Advanced programming Posted: Mon Jun 21, 2010 6:48 am Subject: "Having" attribute in find method |
Hello,
Rails provided another option called "having" on find method. we can also write this in "has_many" and has_and_belongs_to_many associations for filtering data in groupe ... |
Topic: Proc and lambda blocks in ruby |
s.nagesh
Replies: 0
Views: 79
|
: A little Ruby programming (Basic programming in RoR) Posted: Thu Jun 17, 2010 1:21 pm Subject: Proc and lambda blocks in ruby |
Hi,
Proc and Lambda are 2 code blocks in ruby which are used to write number of statements.
A Proc is a code block that has been bound to a set of local variables. Once bound, the code block ... |
Topic: Named scope use in ruby |
s.nagesh
Replies: 0
Views: 91
|
: Advanced programming Posted: Thu Jun 17, 2010 10:41 am Subject: Named scope use in ruby |
Hi,
By using named_scope we can get the data very easily and it will reduce the lot of code. named_scope adds a class method for retrieving and querying objects. A scope represents a narrowing of ... |
Topic: Difference between collection and member |
s.nagesh
Replies: 1
Views: 107
|
: A little Ruby programming (Basic programming in RoR) Posted: Thu Jun 17, 2010 4:06 am Subject: Difference between collection and member |
Hi,
The resources method accepts the following options to customize the resulting routes:
1) :collection - Add named routes for other actions that operate on the collection. Takes ... |
Topic: Single Table Inheritance |
s.nagesh
Replies: 0
Views: 109
|
: Advanced programming Posted: Wed Jun 16, 2010 9:45 am Subject: Single Table Inheritance |
Hi All,
While we are writing the code will use inheritance to express the relationships between abstractions. In some cases we need a situation like
For example Users can have various rol ... |
Topic: Variation of declaring data types in various database |
s.nagesh
Replies: 3
Views: 106
|
: Rails Database setup Posted: Tue Jun 15, 2010 12:17 pm Subject: Variation of declaring data types in various database |
Here is the datatypes for remaining database
Type DB2 mysql openbase oracle
------------------------------------------------------------------------- ... |
Topic: Eval solved the problem of dynamic appending |
s.nagesh
Replies: 0
Views: 57
|
: A little Ruby programming (Basic programming in RoR) Posted: Tue Jun 15, 2010 11:58 am Subject: Eval solved the problem of dynamic appending |
Hi,
While embedding a value to the datbase column name it will throws an error. i tried to append it by using #{} and +. nothing will hep. But when i used eval the problem is solved. i am succ ... |
Topic: Variation of declaring data types in various database |
s.nagesh
Replies: 3
Views: 106
|
: Rails Database setup Posted: Tue Jun 15, 2010 10:32 am Subject: Variation of declaring data types in various database |
Hi to all,
Based on my previous experience i collected some of the datatypes declaration in some databases. Because while executing rake db:migrate many times i have faced few problems due to d ... |
Topic: hide_action tag use |
s.nagesh
Replies: 0
Views: 72
|
: A little Ruby programming (Basic programming in RoR) Posted: Mon Jun 14, 2010 7:39 am Subject: hide_action tag use |
Hi all,
To Hide the some action in controller we will use this tag.
In some cases we will write a method in a controller but if we don’t want it to be accessible as an action to the public, we w ... |
| |