我有这样的事情:
class Actor < ActiveRecord::Base
attr_accessible :name, :actor_movie_relationships_attributes
validates :name
has_many :actor_movie_relationships, autosave: true
has_many :movies, through: :actor_movie_relationships
accepts_nested_attributes_for :actor_movie_relationships
end
和
class ActorMovieRelationship < ActiveRecord::Base
belongs_to :movie
belongs_to :actor
validates :movie, :actor, presence: true
end
由于Actor
可以有很多电影,我想分页用于管理这些关系的ActiveAdmin
表单。
目前我有这个表格(没有分页):
form do |f|
tabs do
tab 'Actor' do
f.inputs 'Basic Information' do
f.semantic_errors *f.object.errors.keys
f.input :name
f.input :deleted
end
end
tab 'Movies' do
f.inputs 'List of movies' do
f.has_many :actor_movie_relationships, heading: '', new_record: 'Add a Movie', allow_destroy: true do |a|
a.input :Movie, collection: Movie.dropdown_names_map.call
end
end
end
end
f.actions
end
知道如何以这种形式向Movies
添加分页吗?