Get an improved navigation experience with a Chrominium based browser.
Dismiss
Ruby Video
Talks
Speakers
Events
Topics
Leaderboard
Sign in
Talks
Speakers
Events
Topics
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RailsConf 2019 - The Elusive Attribute by Chris Salzberg _______________________________________________________________________________________________ Cloud 66 - Pain Free Rails Deployments Cloud 66 for Rails acts like your in-house DevOps team to build, deploy and maintain your Rails applications on any cloud or server. Get $100 Cloud 66 Free Credits with the code: RailsConf-19 ($100 Cloud 66 Free Credits, for the new user only, valid till 31st December 2019) Link to the website: https://cloud66.com/rails?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 Link to sign up: https://app.cloud66.com/users/sign_in?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 _______________________________________________________________________________________________ Is it a method? A database column? Over here, it's a field in a form. Over there, it's a parameter in a request. It's the thing we decorate in our views. It's the thing we filter in our controllers. We call it an “attribute”, and it's all these things and more. We take it for granted, but this innocent little idea is a window into the beating heart of our web framework. Behind its magic are valuable lessons to be learned. Join me as we delve beneath the surface of ActiveModel and ActiveRecord, to the complex abstractions that make attributes so powerful, and so elusive.
Date
Summary
Markdown supported
The video titled "The Elusive Attribute" was presented by Chris Salzberg at RailsConf 2019 and explores the concept of "attributes" in the Ruby on Rails framework. The talk begins by illustrating the complexity of attributes, which can take multiple forms—such as methods in models, database columns, or parameters in requests—highlighting their importance and ubiquity in the Rails ecosystem. Key points discussed include: - **Introduction to Attributes**: Attributes appear simple but are central to Rails functionality, representing a bridge between various elements like views, controllers, and database records. - **Bicycles as a Metaphor**: The speaker uses the analogy of bicycles to explain attributes—they seem straightforward but reveal complexity upon closer examination. Just as most people cannot accurately draw a bicycle despite knowing how to ride one, many Rails users may misinterpret the workings of attributes. - **Internal Structure**: The talk delves into ActiveModel and ActiveRecord, examining how attributes are defined through methods in Ruby, underscoring their role in the hierarchy of these modules. Salzberg mentions a pull request regarding generated attribute methods that highlights the nuanced differences in how attributes interface with models. - **Method Missing Mechanism**: A thorough examination of the Method Missing mechanism demonstrates how Rails handles attributes dynamically, allowing for aliasing and the possibility of accessing attributes not explicitly defined in the schema. This functionality illustrates Rails' flexible architecture but also introduces complexity that can confuse users. - **Optimization and Performance**: The speaker critiques the existing implementation's complexity, suggesting the methods could be restructured for better simplicity that is easier to understand when unpacking Rails. - **Main Takeaway**: Emphasizing the importance of not only understanding but also questioning framework conventions, Salzberg encourages developers to explore Rails deeply, pushing beyond reverence to practical engagement and disassembly of its elements. The conclusion of the talk serves as a call to action: developers should strive not only to use Rails but to interrogate and repair its functionalities, akin to learning to draw a bicycle by attempting to create one from scratch.
Suggest modifications
Cancel