how about this

def name_with_attendence
      [name, attendence].join(' ')
end

def name_with_attendence=(name_attendence)
    if name_attendence
       split_name_and_attendence = name_attendence.split(' ')
       self.name = split_name_and_attendence.first
       self.attendence = split_name_and_attendence.last
    else
      'name and attendece not valid'
    end
end

above i am only checking the presence of name_attendence but not its
format or any other stuff that you might have to add in your model or
code

On Jan 18, 10:09 am, "[email protected]"
<[email protected]> wrote:
> Hi
>
> I have a form which contain a student names and their attendance.
> For each student name there is a text box to input attendance.I want
> to create a connection between the 'name' and it's attendance. I think
> I should merge the student name and the attendance.But could not
> achieve it as yet.
>
> Can nyone give me an idea how to do this.
>
> Thanks
> Viper
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to