Hey Domizio I know I sound stupid, but there isn't any other code. I created this problem as follows:
1) rails generate hobo:resource patient 2) editing the patient.rb file as above (but using using :string) 3) running rails generate hobo:migration 4) changing the :string to enum_string( .... ) as shown Everything else in the app is created by the hobo generator. I haven't got as far as coding anything yet - just defining my model. Am I missing some sort of GemFile dependency here? Everything else is working - and I've even managed to push it up to Heroku. Sorry if I'm being dim! Cheers DJ On Mar 31, 2:20 pm, Domizio Demichelis <[email protected]> wrote: > You should post other parts of your code: as I said that model is ok. > Probably there is some problem in your views. > > ciao > dd > > > > On Thu, Mar 31, 2011 at 8:55 AM, DJ <[email protected]> wrote: > > A problem from a relative Noob (lots of previous programming > > exprerience, new to Rails and Ruby). Any help gratefully received: > > > I'm having trouble understanding what is wrong with this patient.rb > > model file. I have merely substituted ":string" with > > enum_string(:male, :female) it causes the exception: > > > NoMethodError in Patients#show > > > Showing controller: patients; dryml-tag: show-page where line #1 > > raised: > > > undefined method `underscore' for nil:NilClass > > Extracted source (around line #1): > > > The model is as follows: > > > class Patient < ActiveRecord::Base > > > hobo_model # Don't put anything above this > > > fields do > > first_name :string > > last_name :string > > initials :string > > title :string > > gender enum_string(:male, :female) # > > <=========== this line causes an error > > date_of_birth :date > > timestamps > > end > > > (NB, I posted this to lighthouse as a ticket but ddnexus found no > > error). > > > Thanks again for any pointers. > > > DJ > > > -- > > You received this message because you are subscribed to the Google Groups > > "Hobo Users" 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/hobousers?hl=en. -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en.
