On Lunes, 29 de Junio de 2009 14:40:24 JannaB escribió: > Ah, yes, I see that now. So I change the name _from.html.erb to > _formgeneric.html.erb. I have also removed the show action in my > controller with: > > config.actions.exclude :show > > Now, when I hit: > > http://..../channels/display > > in my controller, I have a blank function for 'display' action: > > def display > > end > > That never even seems to get hit. Instead, I get the error: > > Unknown action > > No action responded to show. Actions: attributes_hash_is_empty?, > create, delete, destroy, display, displayx, edit
How have you defined display action in your routes.rb? It seems http://..../channels/display tries to run show action instead of display action. Also, you can override ActiveScaffold show view overriding _show.html.erb instead of excluding it and adding display action. > > How do I get to display.html.erb then? -Janna > > On Jun 28, 10:38 pm, Kerry Foley <[email protected]> wrote: > > 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 %> > > -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
