Talks
Speakers
Events
Topics
Search
Sign in
Search
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
search talks for
⏎
Suggest modification to this talk
Title
Description
This presentation offers a humble explanation of what helper methods are and how they can help you build a lighter and cleaner app. Sam Galindo's pronouns are she/her/they/them. Sam is from Mexico but now lives in the U.S in Durham, North Carolina. She is a baby developer, and new to the Tech Industry. She is a libra that loves dancing, and going on hikes. When she is not glued to her computer reading about technology she is taking deep breaths or laughing with her 6-year-old kid https://www.wnb-rb.dev/meetups/2022/10/25
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the video titled "Stay DRY with Helper Methods" presented by Sam Galindo at the WNB.rb Meetup, the speaker discusses the concept of helper methods within Ruby on Rails. Sam, a relatively new developer, shares her journey and experiences in learning to code while presenting the utility of helper methods in creating cleaner, more manageable code. **Key Points Presented:** - **Introduction to Helper Methods:** - Helper methods are defined as macros for models and controllers that extract complex logic or duplicate code into reusable methods. - They are commonly used in Ruby on Rails to simplify coding tasks such as handling forms and generating links. - **Application of Helper Methods:** - Sam illustrates her understanding of helper methods through a personal example involving user group management in her code. - She faced challenges with button text that failed to change based on the form's action (creating or editing a group). - With guidance from her mentor, she learned to implement a helper method that efficiently manages this logic without cluttering her views. - **Placement and Organization of Helper Methods:** - Sam advises that the best place to organize helper methods is within the appropriate helper files instead of dumping them into the application helper, which can lead to disorganized code. - Helper methods can also be added to controllers, making them accessible throughout various parts of the application. - **Common Pitfalls and Best Practices:** - Sam warns against creating multiple helper methods with the same name, as this could lead to confusion. - Developers should avoid overusing the application helper to prevent it from becoming a catch-all for miscellaneous code. - **Conclusion and Flexibility:** - Sam concludes by emphasizing the importance of flexibility and adapting the use of helper methods to fit the needs of the application and the development team. - The speaker suggests considering alternative options like decorators if they suit the project's requirements better than traditional helper methods. Overall, the presentation serves as a practical guide for new developers to understand and implement helper methods effectively, promoting cleaner code and adherence to the DRY (Don't Repeat Yourself) principle.
Suggest modifications
Cancel