How to implement dependent dropdowns in Rails 4 with an unobtrusive jQuery script

I recently had to implement a view with the classic search form with two select dependent on each other. My aim was to leave the page as clean as possible and make the code that loads the options for the daughter dropdown reusable.Suppose, therefore, to have two models, SpecializationType and Specialization, defined as follows:1234567891011121314151617181920212223242526272829303132class SpecializationType < ActiveRecord::Base # FIELDS # RELATIONS has_many :specializations ...

Read more

A new layout easier and more spacious

In the last days we have spent a bit of our time to do a full redesign of our website and our blog. The result is what you are looking while reading this article. Specifically, the innovations we introduced in both the theme of the blog and the web site are: Wider layout splitted into two columns also for the website Blog contents with more space, which is very useful when showing code snippets A wide and straight header that shows the key points of each page A wider foote...

Read more
Ruby on Rails and jQuery: multiselect with checkbox

Ruby on Rails and jQuery: multiselect with checkbox

Today I want to present a very convenient jQuery plugin I’ve used to create a combo box with checkboxes for a multi-selection field.Suppose we have a form of insertion / modification of user data, and that the user can have multiple functions. We start with rendering the form with a multi-selection field, where you can select more functions w...

Read more