On Miércoles, 10 de Agosto de 2011 08:15:46 waseem ahmad escribió: > Dear all, > > I have a model ListingMovie: > > class ListingMovie > has_many :movie_shows, :dependent => :destroy > belongs_to :movie > ... > ... > end > > and MovieShow: > > class MovieShow > belongs_to :listing_movie > > validates_presence_of :start_time, :end_time > end > > I have Manage::ListingMoviesController: > > class Manage::ListingMoviesController < Manage::BaseController > helper Mange::MovieShowsHelper > > active_scaffold :listing_movie do |config| > > config.columns = [:movie, :listing, :start_date, :end_date, > > :movie_shows] > > config.columns[:listing].form_ui = :select > config.columns[:movie].form_ui = :select > end > > protected > > def self.active_scaffold_controller_for(klass) > return Manage::MoviesController if klass == Movie > return Mange::MovieShowsController if klass == MovieShow > end > end > > and Manage::MovieShowsController > > class Manage::MovieShowsController < Manage::BaseController > active_scaffold :movie_show do |config| > config.subform.columns = [:start_time, :end_time] > end > end > > > When I try to create/update a ListingMovie, I am shown a form that has a > "Create Another Movie Show" the end. Earlier when I clicked it, it made an > Ajax request and added two new fields at the bottom of the form that let me > specify start_time and end_time for associated MovieShow. Now When I click > on it, no request is made to the server. And hence new fields are not added > to the form. > > Following is the HTML of the button: > > <input data-remote="true" > href="/manage/listing_movies/edit_associated?association=movie_shows" > id="as_manage__listing_movies--movie_shows-subform-create-another" style="" > type="button" value="Create Another Movie show"> > > I am unable to debug this as I can see any errors. Clicking the button > simply does nothing. >
Do you get some javascript errors with firebug? > One thing to notice is that if I put some erroneous data in the form and > then try to "Create/Update" a ListingMovie, the form is rendered again with > a "new" form fields to specify start_time and end_time. -- 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.
