Ruby on rails 如何将作为标记的行为集成到RailsAdmin?
是否有人在RailsAdmin上充当标签?我正在努力,但对我不起作用 我的环境:Ruby on rails 如何将作为标记的行为集成到RailsAdmin?,ruby-on-rails,ruby-on-rails-3,acts-as-taggable-on,rails-admin,Ruby On Rails,Ruby On Rails 3,Acts As Taggable On,Rails Admin,是否有人在RailsAdmin上充当标签?我正在努力,但对我不起作用 我的环境: **Gems included by the bundle: * actionmailer (3.2.13) * actionpack (3.2.13) * activemodel (3.2.13) * activerecord (3.2.13) * activeresource (3.2.13) * activesupport (3.2.13) * acts-as-taggable-o
**Gems included by the bundle:
* actionmailer (3.2.13)
* actionpack (3.2.13)
* activemodel (3.2.13)
* activerecord (3.2.13)
* activeresource (3.2.13)
* activesupport (3.2.13)
* acts-as-taggable-on (2.3.3)
* acts_as_votable (0.4.0)
* addressable (2.3.3)
* arel (3.0.2)
* bcrypt-ruby (3.0.1)
* best_in_place (2.1.0)
* better_errors (0.6.0)
* bootstrap-sass (2.3.1.0)
* bootstrap-wysihtml5-rails (0.3.1.19)
* builder (3.0.4)
* bundler (1.3.2)
* cache_digests (0.2.0)
* cancan (1.6.9)
* coderay (1.0.9)
* coffee-rails (3.2.2)
* coffee-script (2.2.0)
* coffee-script-source (1.6.2)
* daemons (1.1.9)
* database_cleaner (0.9.1)
* delayed_job (3.0.5)
* delayed_job_active_record (0.3.3)
* devise (2.2.3)
* diff-lcs (1.1.3)
* erubis (2.7.0)
* execjs (1.4.0)
* fabrication (2.6.1)
* faraday (0.8.7)
* ffaker (1.15.0)
* font-awesome-sass-rails (3.0.2.2)
* haml (4.0.1)
* hashie (1.2.0)
* hike (1.2.1)
* httpauth (0.2.0)
* i18n (0.6.1)
* journey (1.0.4)
* jquery-rails (2.2.1)
* jquery-ui-rails (3.0.1)
* json (1.7.7)
* jwt (0.1.8)
* kaminari (0.14.1)
* kgio (2.8.0)
* koala (1.6.0)
* mail (2.5.3)
* mime-types (1.21)
* multi_json (1.7.2)
* multipart-post (1.2.0)
* nested_form (0.3.1)
* nokogiri (1.5.9)
* oauth2 (0.8.1)
* omniauth (1.1.3)
* omniauth-facebook (1.4.1)
* omniauth-oauth2 (1.1.1)
* orm_adapter (0.4.0)
* pg (0.14.1)
* polyglot (0.3.3)
* rack (1.4.5)
* rack-cache (1.2)
* rack-pjax (0.7.0)
* rack-ssl (1.3.3)
* rack-test (0.6.2)
* rails (3.2.13)
* rails_admin (0.4.6)
* rails_admin_tag_list (0.1.5)
* railties (3.2.13)
* raindrops (0.10.0)
* rake (10.0.4)
* rdoc (3.12.2)
* remotipart (1.0.5)
* rspec-core (2.12.2)
* rspec-expectations (2.12.1)
* rspec-mocks (2.12.2)
* rspec-rails (2.12.2)
* safe_yaml (0.9.0)
* sass (3.2.7)
* sass-rails (3.2.6)
* simplecov (0.7.1)
* simplecov-html (0.7.1)
* sprockets (2.2.2)
* strong_parameters (0.2.0)
* thor (0.18.0)
* tilt (1.3.6)
* treetop (1.4.12)
* tzinfo (0.3.37)
* uglifier (1.3.0)
* unicorn (4.6.2)
* warden (1.2.1)
假设你有后模特
class Post < ActiveRecord::Base
attr_accessible :title, :user_id, :content, :tag_list
acts_as_taggable
end
仅此而已,以下是包含上述场景的示例项目:
有什么错误吗?我能知道什么是不起作用的吗?我曾在一些项目中尝试过这种方法。负责后端的人让它工作了很多次,但是每次rails\u管理员或rails更新,整个事情都会崩溃,失控。我强烈建议您开始考虑编写自己的后端,因为虽然rails_admin非常适合开始工作,但您越是尝试自定义它,它只会变得更加复杂和令人沮丧,而且它节省的时间与维护自定义rails_admin设置所需的时间相比变得微不足道。
config.model Post do
list do
field :title
field :tag_list
end
edit do
field :title
field :tag_list do
html_attributes do
{:style => "width:90%"}
end
end
field :content
end
end