Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

formbuilder

Symfony 2 – how to pass data to formBuilder?

September 12, 2023 by Tarik
Categories php Tags formbuilder, php, symfony Leave a comment

How do I get the HTML ‘name’ attribute a rails form builder will generate for a certain field?

September 11, 2023 by Tarik

After inspecting the form object, I found that you can get the object_name from it. So this worked well for me: “#{f.object_name}[field_name]” Which will generate: object[object_attributes][0][field_name]

Categories ruby-on-rails Tags form-helpers, formbuilder, forms, ruby-on-rails Leave a comment

fields_for form builder object is nil

August 20, 2023 by Tarik

You must have accepts_nested_attributes_for in the Project model in order for the object to be passed. class Project < ActiveRecord::Base has_many :tasks accepts_nested_attributes_for :tasks ## this is required end

Categories ruby-on-rails Tags formbuilder, ruby, ruby-on-rails Leave a comment

Symfony2 file upload step by step

April 15, 2023 by Tarik

Do you know now what are the ‘important’ function to add to be able to upload the photo and rename it? See the official documentation on how to do this. There are good working examples for a simple file upload. Also check the doctrine documentation for lifecycle callbacks. How do you check the extension to … Read more

Categories file Tags doctrine-orm, file, formbuilder, symfony, upload Leave a comment

How to set a class attribute to a Symfony2 form input

March 3, 2023 by Tarik

You can do this from the twig template: {{ form_widget(form.birthdate, { ‘attr’: {‘class’: ‘calendar’} }) }} From http://symfony.com/doc/current/book/forms.html#rendering-each-field-by-hand

Categories php Tags formbuilder, forms, input, php, symfony Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa