hi,
   When i am trying to render the data from the table i am getting the
following error

Action Controller: Exception caught

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.items

app/views/categories/_list.rhtml:13:in
`_run_erb_47app47views47categories47_list46rhtml'
app/views/categories/index.html.erb:9:in
`_run_erb_47app47views47categories47index46html46erb'
app/controllers/categories_controller.rb:18:in `index'
:1:in `initialize'

please help me in this

On Wed, Nov 12, 2008 at 3:33 AM, Student <[EMAIL PROTECTED]> wrote:

>
> Articles can be tagged.  The tags table contains a name and value.
> Each article can only have one tag with a given name.  In the article
> update page, I want to be able to select a name for a tag from a
> dropdown, then a value for the tag from a dependent dropdown.  (For
> example, the "importance" tag might have values "who cares?", "walk
> away", and "run for the hills!".  The "credibility" tag might have
> values "tin foil", "omg", "TRVTH".)
>
> What I'm getting is two empty dropdowns.  I have defined name_column
> and value_column in ArticleTagsHelper, but they are not being called.
>
> Help?
>
>
> class Article < AR::B
> ...
>  has_many :article_tags
> ...
> end
>
> class ArticleController < AC
> ...
>  config.columns = [ ... :article_tags]
> ...
> end
>
> class Tag < AR:B
>  validates_presence_of :name
>  validates_presence_of :value
>  validates_uniqueness_of :value, :scope => :name
>  has_many :tag_values, :dependent => :destroy
> end
>
> class ArticleTag < AR::B
> ...
>  validates_presence_of :article_id
>  validates_presence_of :tag_id
>  belongs_to                 :article
>  belongs_to                 :tag
>  validates_uniqueness_of :article_id, :scope => name
>  def name
>    tag ? tag.name : nil
>  end
>  def value
>    tag ? tag.value : nil
>  end
> end
>
> class ArticleTagsController < AC
> ...
>    config.columns = [:article, :name, :value]
>    config.subform.columns.exclude :article
>    config.columns[:name].form_ui = :select
>    config.columns[:name].required = true
>    config.columns[:value].form_ui = :select
>    config.columns[:name].required = true
> ...
>  end
>
>
> Pointers?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to