symfony2 multiple nested forms prototype

forms and prototype You need to keep two prototypes from different collections. Symfony offers to store them in a data-prototype attribute of div tag, which wrap the collection. In your situation it`s very inefficient. So you can just render it by hand in empty div somethere Example you have characters form class CharacterType extends AbstractType … Read more

Rails – Using form_for and fields_for, how do you access the sub-object while in the fields_for block?

I just dealt with this today myself. You can access the object of the fields_for through: builder.object where builder is your fields_for form builder object. In your particular case, you can say: <p>Enter license for car parked in stall: <%= builder.object.stall_number%></p> That should do it for you!

Error in slick.js: “Uncaught TypeError: Cannot read property ‘add’ of null”

That’s due to calling init twice. This works without error: $(“.slider”).not(‘.slick-initialized’).slick() Also, “silder” looks like a typo. Relying on a timeout is also error-prone. Unfortunately, Internet Explorer uses a different event to tell you when the HTML elements and JS libraries have been loaded. There are many libraries to avoid the 100 or so lines … Read more

Rails nested form with has_many :through, how to edit attributes of join model?

Figured out the answer. The trick was: @topic.linkers.build.build_article That builds the linkers, then builds the article for each linker. So, in the models: topic.rb needs accepts_nested_attributes_for :linkers linker.rb needs accepts_nested_attributes_for :article Then in the form: <%= form_for(@topic) do |topic_form| %> …fields… <%= topic_form.fields_for :linkers do |linker_form| %> …linker fields… <%= linker_form.fields_for :article do |article_form| %> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)