Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Trouble with enum field
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bill Lazar  
View profile  
 More options May 25 2012, 2:43 pm
From: Bill Lazar <bstgro...@gmail.com>
Date: Fri, 25 May 2012 11:43:52 -0700
Local: Fri, May 25 2012 2:43 pm
Subject: Trouble with enum field
I have a fairly simple (I hope) set up that just doesn't work right and I'd appreciate assistance in properly configuring it.

Model is Event, with a field called status, in the model I have a method status_enum that returns an array of strings and attr_accessible on the status field. In rails_admin.rb inside the Event model block I have:

  config.model Event do
    edit do
      field :status
    end
  end

Result is the edit page shows the current value of the field, read only.

I also tried these variations with no different/better results:

  config.model Event do
    edit do
      field :status, :enum
    end
  end

  config.model Event do
    edit do
      field :status, :enum do
        enum_method do
          :status_enum
        end
    end
  end

Thanks,
Bill


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benoit Bénézech  
View profile   Translate to Translated (View Original)
 More options May 31 2012, 8:06 am
From: Benoit Bénézech <benoit.benez...@gmail.com>
Date: Thu, 31 May 2012 05:06:51 -0700 (PDT)
Local: Thurs, May 31 2012 8:06 am
Subject: Re: Trouble with enum field

You need to check that status is attr_accessible.

Le vendredi 25 mai 2012 20:43:52 UTC+2, BillSaysThis a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bill Lazar  
View profile  
 More options May 31 2012, 10:46 am
From: Bill Lazar <bstgro...@gmail.com>
Date: Thu, 31 May 2012 07:46:03 -0700
Local: Thurs, May 31 2012 10:46 am
Subject: Re: Trouble with enum field

Thanks that was the answer. Didn't remember that 3.2 required a_a and this started as a 3.0 project.

Similarly though I'm having trouble with two has_many associations:

Class Event
  has_many :presentations
  has_many :speakers, through: :presentations

attr_accessible ..., :speakers, :presentations

Neither show up as fields at all on the edit page.

On May 31, 2012, at 5:06 AM, Benoit Bénézech wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »