#ProposalsController
active_scaffold :project do |config|
    config.label = "Proposal Information"
    config.columns =
[:nice_name, :client_nice_name, :director, :manager, 
:event_proposal_sent_first, :final_proposed_amount, :probability, 
:decision_date]
    config.list.columns =
[:nice_name, :director, :manager, :probability, :decision_date]
    config.columns[:nice_name].label = "Project"
    config.columns[:event_proposal_sent_first].label = "Proposal Sent"
    config.columns[:event_proposal_sent_first].includes = [:events]
    config.columns[:manager].includes = [:manager]
    config.columns[:director].includes = [:director]
    config.columns[:nice_name].sort = true
    config.columns[:nice_name].sort_by :sql => "id"
    config.columns[:client_nice_name].includes = [:client]
    config.columns[:final_proposed_amount].includes = [:revisions]
    config.columns[:final_proposed_amount].label = "Proposed Amount"
    config.columns[:final_proposed_amount].css_class = "rightJTD"
    config.columns[:final_proposed_amount].css_class = "rightJTD"
    config.update.columns = [:probability, :decision_date]
    config.columns[:decision_date].required = true
    config.columns[:decision_date].description = "Enter the new
Decision Date"
    config.show.columns =
[:client_nice_name, :project_director, :project_manager, 
:event_proposal_sent_first,:final_proposed_amount, :probability, :decision_date]
    config.columns[:client_nice_name].label = "Client"
    list.sorting = {:id => 'DESC'}
    config.list.per_page = 50
    config.actions.exclude :search, :create
    config.actions.exclude :delete
    config.columns[:manager].actions_for_association_links = []
    config.columns[:director].actions_for_association_links = []

  end

#AjaxController
  active_scaffold :project do |config|
    config.label = "Projects"
    config.list.columns =
[:id, :city, :region, :country, :status_type, :office_location]
    config.columns =
[:id, :city, :region, :country, :status_type, :office_location]
    config.columns[:id].label = "Project"
    config.columns[:id].css_class = "leftJ"

    config.columns[:status_type].label = "Status"
    config.columns[:status_type].includes = [:events, :status_type]
    config.columns[:office_location].label = "Office"
    config.columns[:status_type].actions_for_association_links = []
    config.columns[:office_location].actions_for_association_links =
[]

    config.update.link.controller = "projects"
    config.create.link.controller = 'projects'
    config.update.link.page = true
    config.columns[:region].label = "State/Region"

    config.actions.exclude  :search
    config.columns[:status_type].form_ui= :select
    config.columns[:office_location].form_ui = :select
    config.columns[:project_types].form_ui = :select
    config.columns[:proposed_types].form_ui = :select
    config.columns[:manager].form_ui = :select
    config.columns[:director].form_ui = :select

    config.action_links.add 'teammates', :controller => 'ajax', :label
=> 'Team', :type => :member, :inline => true
    config.delete.link = false
    list.columns.exclude :comments
    list.sorting = {:id => 'DESC'}
    config.list.per_page = 50

  end

#Associations
Proposals uses the Project model not an association

#routes
  map.resources :ajax, :active_scaffold => true
  map.resources :proposals, :active_scaffold => true


On Oct 28, 12:23 pm, Soren Christensen <[email protected]> wrote:
> Post the ActiveScaffold configuration portion of the two controllers in 
> question.
> Post the model associations between project and proposals.
>
> Make sure that you have your routes correctly configures with:
>   map.resources :projects, :active_scaffold => true
>   map.resources :proposals, :active_scaffold => true
>
> On Oct 28, 2010, at 8:16 PM, anithri wrote:
>
>
>
>
>
>
>
> > Updating my project to rails 2.3.8 and the latest ActiveScaffold.
> > However, this has broken some of my controllers and I can't figure out
> > why.
>
> > I have a Project model that used to use the following controllers.
>
> > ProjectsController (non AS, used for a myriad of purposes including
> > Project Creation and Edit forms, those required more customization
> > than I could handle in AS)
> > AjaxController (AS, main view for Projects)
> > ProposalsController (AS, specialized view of some of Projects, limited
> > by user, meant to be updated frequently without the hassle of having
> > to edit the entire document)
>
> > These worked great before the update, now not so much.
>
> > I'm getting this error, when I try to Show or Edit in the
> > ProposalsController.
>
> > <code>
> > Processing ProposalsController#edit (for 127.0.0.1 at 2010-10-28
> > 11:38:47) [GET]
> >  Parameters: {"action"=>"edit", "_method"=>"get",
> > "adapter"=>"_list_inline_adapter", "id"=>"5687",
> > "controller"=>"proposals"}
> > Project Load (0.7ms)  SELECT * FROM `projects` WHERE (`projects`.`id`
> > = 5687)
>
> > ActionView::TemplateError (ProjectsController missing ActiveScaffold)
> > on line #14 of vendor/plugins/active_scaffold/frontends/default/views/
> > _form.html.erb:
> > 11:   </li>
> > 12:   <% else -%>
> > 13:   <li class="form-element <%= 'required' if column.required? %> <
> > %= column.css_class unless column.css_class.nil? %>">
> > 14:     <%= render :partial =>
> > form_partial_for_column(column), :locals => { :column => column } -%>
> > 15:   </li>
> > 16:   <% end -%>
> > 17:   <% end -%>
>
> >    vendor/plugins/active_scaffold/frontends/default/views/
> > _form.html.erb:14
> >    vendor/plugins/active_scaffold/frontends/default/views/
> > _form.html.erb:2
> >    vendor/plugins/active_scaffold/frontends/default/views/
> > _update_form.html.erb:45
>
> > Rendered rescues/_trace (120.5ms)
> > Rendered rescues/_request_and_response (1.7ms)
> > Rendering rescues/layout (internal_server_error)
> > </code>
>
> > I've seen a few posts about using active_scaffold_controller_for and
> > using it in the ProposalsController does allow me to use show/edit.
> > Is this the right approach to use in my case?  Maybe to make things
> > easier for future users we should add a decorator for a Controller
> > ("active_scaffold_for :project")  to make it easier to setup corner
> > cases like this?  Or is there something else I'm doing wrong?
>
> > --
> > 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 
> > athttp://groups.google.com/group/activescaffold?hl=en.

-- 
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