background preloader

14

Facebook Twitter

Web Developers resource for HTML, CSS, Javascript, PHP, SQL and Linux. Dive Into HTML5. Devoth's HEX 2 RGBA Color Calculator. CSS3 Generator. Fonts.com. Typekit. Web Fonts. Handpicked free fonts for graphic designers with commercial-use licenses. Jcasimir/draper. Web Application Performance Management (APM) PeepCode | Programming and Development Tutorial Screencasts for Web Developers and Alpha Geeks.

Complex Rails Forms with Nested AttributesRubySource. Rails provides a powerful mechanism for easily creating rich forms called “nested attributes.” It allows you to combine more than one model in your forms while keeping the same basic code pattern that you use with simple single model forms. In this article I’ll be showing a number of different ways to use this technique. I’ll assume that you’re familiar with basic Rails forms, of the kind that are generated by the scaffolding commands. We’ll be building up a complex form step by step that allows a user to edit their preferences. Our domain is a not-for-profit management system, where volunteers (users) have areas of expertise and tasks that have been assigned to them. The Base Form Let’s start with a basic form that can edit a user. First up is a simple user model with just one attribute: We will be using the same controller for the entire of this article.

Our base form is exactly what is generated by the Rails scaffolding: With that out of the way, let’s dive in! Adding an Address. RubySource » For Ruby & Rails Developers | Ruby on Rails Tutorials | Learn Ruby | Gems | Strings and MoreRubySource. Flyerhzm/bullet.