Episodes tagged with “active-record”
-
251
MetaWhere & MetaSearch Other translations:
MetaWhere provides a way to do complex find conditions without SQL in Active Record. MetaSearch makes it easy to create search forms with many find options.
Tags: rails-3.0 plugins active-record forms search
-
239
ActiveRecord::Relation Walkthrough Other translations:
The new Active Record query methods in Rails 3 might seem like magic at first. In this episode we unravel how it works by browsing the Rails 3 source code.
Tags: rails-30 active-record
-
217
Multistep Forms Other translations:
In this episode we create a multistep form, or wizard, from scratch.
Tags: forms views active-record
-
215
Advanced Queries in Rails 3 Other translations:
Learn some advanced techniques regarding named scopes and get an introduction to Arel in this episode.
Tags: rails-30 active-record
-
212
Refactoring & Dynamic Delegator Other translations:
Learn how to refactor a set of conditional Active Record queries using a Dynamic Delegator.
Tags: refactoring active-record rails-30
-
211
Validations in Rails 3 Other translations:
Rails 3 offers several new additions to validations. Here learn how to make a custom error_messages partial, reflect on validations, and clean up complex validations in a model.
Tags: rails-30 forms active-record views
-
202
Active Record Queries in Rails 3 Other translations:
Rails 3 introduces a new query interface for performing finds in Active Record. See how it works along with the changes in named scopes.
Tags: rails-30 active-record
-
196
Nested Model Form Part 1 Other translations:
The accepts_nested_attributes_for method, introduced in Rails 2.3, makes handling multiple models in a form much easier. Find out how to use it in this episode.
Tags: forms views active-record
-
193
Tableless Model Other translations:
If you want to create a model without an associated database table all you need to do is define a couple methods in the model.
Tags: active-record
-
189
Embedded Association Other translations:
In this episode we show you how to embed a one-to-many or many-to-many association in a single integer field.
Tags: active-record views
-
181
Include vs Joins Other translations:
The find method’s include and joins options can be a little confusing as they are so similar. Find out when to use which one in this episode.
Tags: active-record
-
135
Making a Gem
Gems are now a more popular way of extending Rails than plugins. In this episode we go through the steps needed to create a basic gem.
Tags: plugins active-record tools
-
179
Seed Data Other translations:
Rails 2.3.4 introduces a new convention for creating any seed data that your application needs. This means that you no longer have to put seed data in your migrations.
Tags: active-record rails-23
-
178
Seven Security Tips Other translations:
Security is paramount in your Rails applications. Here we show seven commons security flaws from mass assignment to CSRF.
Tags: security forms views active-record
-
177
Model Versioning Other translations:
If you need to keep track of the changes to an ActiveRecord model and switch between versions the Vestal Versions gem is well worth considering.
Tags: active-record plugins
-
33
Making a Plugin Other translations:
Duplication can often be removed from your Ruby code by making methods dynamically. In this episode we make a plugin to do just that.
Tags: active-record plugins
-
176
Searchlogic
Searchlogic uses named scopes to make searching against models simple. See how to create simple and more complex searches in this episode.
Tags: active-record plugins
-
168
Feed Parsing Other translations:
In this episode we use two different techniques to parse an RSS feed with Feedzirra.
Tags: plugins active-record
-
163
Self Referential Association Other translations:
In this episode we create a small social networking application and use a self-referential association to link users with their friends.
Tags: active-record controllers
-
162
Tree Based Navigation
The acts_as_tree plugin provides a good solution for handling a tree-based navigation. In this episode we build a navigation system with menus, subpages and a breadcrumb control.
Tags: active-record plugins
-
154
Polymorphic Association Other translations:
Polymorphic associations can be a little tricky to understand. In this episode we'll show you how to create one and use it in controllers and views.
Tags: active-record routing
-
152
Rails 2.3 extras
A round of some of the smaller new feaures in Rails 2.3 to finish the short series on Rails 2.3.
-
32
Time in Text Field Other translations:
Updating time fields via a series of dropdowns isn't the most elegant way to enter date and time information. Find out how to allow your users to enter dates and time in a text field instead.
Tags: active-record forms
-
147
Sortable Lists
Find out how to create a drag and drop list using prototype and one of Rails’ helper methods.
Tags: active-record plugins ajax routing
-
26
Hackers Love Mass Assignment Other translations:
If you're using mass assigment you're giving complete control to your models to your users. Learn how to protect them in this episode.
Tags: security active-record forms
-
25
SQL Injection Other translations:
Attacks via SQL injection are one of the most common ways to attack web applications. Learn how to avoid being a victim of it.
Tags: security active-record forms
-
23
Counter Cache Column Other translations:
Improve performance by caching the record count for a has_many association in a counter cache column.
Tags: performance active-record
-
22
Eager Loading Other translations:
Improve the performance of your Rails application by reducing the number of database queries. Eager loading makes it easy.
Tags: performance active-record
-
16
Virtual Attributes Other translations:
Keep your forms flexible by adding virtual attributes to your model. This powerful technique allows you to create form fields which may not directly relate to the database.
Tags: active-record forms
-
15
Fun With Find Conditions Other translations:
You can pass objects other than strings to find conditions, but care must be taken to ensure that the correct SQL is generated.
Tags: active-record
-
14
Performing Calculations On Models Other translations:
ActiveRecord provides class methods for performing calculations on models. See how in this episode.
Tags: active-record
-
5
Using with_scope Other translations:
Learn how to use with_scope - a very powerful method which will allow your custom find method to acceps any find options.
Tags: active-record
-
4
Move Find Into Model Other translations:
Clean up your controllers and remove duplication by moving a find into your model. Use an association to call custom find methods.
Tags: active-record
-
3
Find Through Association Other translations:
Use a has_many association in a find to avoid the need to pass foreign keys.
Tags: active-record
-
2
Dynamic find_by Methods Other translations:
Shorten simple find and improve readability by using the dynamic find_by and find_all_by methods.
Tags: active-record