English 中文(简体)
2. 在铁路中建立海关特制表格
原标题:Creating custom nested forms in RailsAdmin

我正试图为我的一种模型制造一种带宽的铁路Admin的习惯形式,以便增加比在植被中增加功能。

我有一个项目,即“many TechSpecs”。 在我的铁路——行政——初步驾驶员中,我有以下几处。

config.model Project do
  edit do
    configure :tech_specs do
      partial  tech_specs_field 
    end
  end
end

In _tech_specs_field.html.haml (如果一个人对er子更舒适,但我会非常奇怪,“除非我使用ham子,否则不会有安全的方法。 我

= form.fields_for(field.name) do |nested_form|
  = render :partial =>  spec , :locals => {:nested_form => nested_form}

- add = "<i class= icon-plus icon-white ></i> New Tech Spec".html_safe
= form.link_to_add add, field.name, { :class =>  btn btn-info  }

实际上,我看看上页上在底层隐藏的散射中产生的新技术-光谱的蓝图,但点击新技术Specutton没有。 Inside_spec.html.haml is only a bunch of text_fields andidden_fields + themovlink (eds).

我很想知道两点:

(1) 我怎么能够追踪在联合材料中应当发生的情况,并把它或我的一部分放在与铁路Admin号表格合作上,这些表格来自苯ech-仿(铁路运输取决于铁路)

2) 任何想法,为什么我的一部分人不得不坐在轮椅上,而不是在什么铁路用什么,以及某种方式在产生行政形式的大规模链条上是不相容的?

最佳回答

这不是一个好的最终答案,但我得以在紧靠以下共同提交文件黑板时解决这一问题。 j)

  var oldNestedFormEvents = window.nestedFormEvents.insertFields
  window.nestedFormEvents.insertFields = function (content, assoc, link) {
    if ($(link).closest( .no_tabs ).length > 0) {
      return $(content).insertBefore(link);
    } else {
      return oldNestedFormEvents(content, assoc, link);
    }
  }

关于我想要使用封套表格的习俗部分,我只是在其含有干.和重复使用时添加“不成表格”类别。

问题回答

暂无回答




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签