You have unintentionally taken advantage of the ability to override AS
default views. AS will look in views/<model> to override at the model
level or views/active_scaffold_overrides to do it at the application
level. In particular your _form.html.erb is the problem. Give it a
different name and your problem will go away and AS will work again.
You can see the views that AS uses in
vendor/plugins/active_scaffold/frontends/default/views
Don't use views with the same name unless you are trying to override AS.
Regards,
Kerry
JannaB wrote:
> I have a model with a corresponding controller, helper and views, set
> up to run AS and it works swimmingly. However, I also need to use
> those views and that controller to display different functionality off
> of that model.
>
> When I add new views into the model's view directory (the model is
> called 'channels') AS stops working (i.e., the list fuctionality
> works, but if I go to edit a record from list, it doesn;t work,
> instead, the view that gets displayed are the views corresponding to
> my other controller methods I have added in. I am enclosing my
> controller methd and the subsequent views below in hopes someone can
> help me restore the original AS edit functionality. Thanks, Janna B.
> p.s. a lot of the code I have in here is purely for debugging purposes
> right now
>
> class Channel < ActiveRecord::Base
> has_many :ups
> has_many :openfloors
> has_many :doors
> has_many :associates
>
> attr_accessor :minimenu
>
>
> def to_s
> channel
> end
> end
>
>
> class ChannelsController < ApplicationController
> active_scaffold :channel do |config|
> config.label = "Uplogs"
> config.create.columns =
> [:channel,floatertype, :frozentype, :slushytops, :autoopen, :autoclose,
> :decktype, :webroot, :servername, :port]
> config.update.columns =
> [:channel :floatertype, :frozentype, :slushytops, :autoopen, :autoclose,
> :decktype, :webroot, :servername, :port]
> config.list.columns =
> [:channel, :defbranchcode, :servername, :port]
> config.actions.swap :search, :live_search
> end
>
>
> def display
>
> end
>
> def hotwire
> minimenu='hotwire'
> render :action => 'display'
> end
>
> def newchannel
> #puts params[:ups][:channel_id]
> channel_id_you_want = params[:ups][:channel_id]
> render :action => 'display'
> end
> end
>
>
> #------ display.html.erb:-----------------------
> <%= render :partial => 'form' %>
>
> #----- -_form.html.erb:-------------------------
> <%= render :partial => 'top' %>
> <div id="UpLogBody">
> <% if @minimenu == 'hotwire' %>
> <%= render :partial => 'hotwire' %>
> <% end %>
> </div>
>
> #---------- _top.html.erb--------------------------
> <div id="uplognavlist">
> <%= links_for_uplog %>
> <% form_for :ups, :html => {:name => 'channelsform'},:url=>{ :action
> =>"newchannel", :controller =>"ups"} do |f| %>
> <%= f.label :channel_id %>
> <%= f.select(:channel_id , Channel.find(:all, :order => 'channel
> ASC', :conditions => ['deleted=0']).collect {|p| [ p.channel,
> p.id ]}, {:include_blank => true}, { :onchange =>
> "document.channelsform.submit();"}) %>
> <% if is_mobile_device? %>
> <%= f.submit "Change" , :class=>'button' %>
> <% end %>
> <%end%>
> </div>
>
> #---------- _hotwire.html.erb ------------------
> this is hotwire!
> <%= @channel_id.to_s %>
> <%= @minimenu %>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---