Explore tweets tagged as #RailsTips
#RailsTips ๐ธ. Small hack to reduce database call๐. On optional association, when u want to check associated model presence(country), instead of using - . โฏ ๐๐๐ฒ๐ฟ.๐ฐ๐ผ๐๐ป๐๐ฟ๐.๐ฝ๐ฟ๐ฒ๐๐ฒ๐ป๐? . you can use . โฏ ๐๐๐ฒ๐ฟ.๐ฐ๐ผ๐๐ป๐๐ฟ๐_๐ถ๐ฑ.๐ฝ๐ฟ๐ฒ๐๐ฒ๐ป๐?. #RubyOnRails
7
19
113
#ActiveSupport's `.presence` lets us write cleaner code. It returns the object if it's present, nil otherwise. No more tedious nil checks! Easily assign a default value when the parameter is nil or empty! #RailsTips #RubyTips #CleanCode
5
6
59
๐ Rails tip of the day:. To eliminate N+1 query woes, always preload associations with `includes`:. Save those DB hits! ๐.#RubyOnRails #RailsTips
0
0
0
#RailsTips ๐ธ. Did u know that ActiveSupport::Inflector class has methods for transforming words & strings between different formats?. This week we'll be going to explore couple of methods that you might not aware of. Have a look - . #RubyOnRails
2
5
39
#RailsTips ๐ธ. Rails framework has lots of configs available. This week we'll be going to explore couple of configs that will be useful for most Rails apps -. ๐ ๐ฐ๐ผ๐ป๐ณ๐ถ๐ด.๐ฑ๐ถ๐๐ฎ๐ฏ๐น๐ฒ_๐๐ฎ๐ป๐ฑ๐ฏ๐ผ๐
.๐ ๐ฐ๐ผ๐ป๐ณ๐ถ๐ด.๐ณ๐ผ๐ฟ๐ฐ๐ฒ_๐๐๐น. Have a look -. #rubyonrails #rails
2
5
47
#RailsTips ๐ธ. More hidden gems from the ActiveSupport::Inflector class!. Today we're exploring two methods you may not know about: demodulize and deconstantize. These can be handy for dynamically generating class and module names based on other information. #RubyOnRails
1
4
31
Protecting sensitive data in Rails logs is crucial for security & audit purposes. #securitytips.For example, lets you hide the user's email id/CC from the log, it's quite simple.#rails #railstips #part2 #rubyonrails
0
1
6
#RailsTips ๐ธ. Discovering more hidden gems from ActiveSupport::Inflector today! . Check out constantize for dynamically loading class based on its name (great for plugins) and safe_constantize for gracefully handling cases where class may not exist. Have a look - . #RubyOnRails
4
1
21
#RailsTips ๐ธ. You can use the `render` method to display content in a different format such as JSON or XML. This can be useful when working with APIs. For example, to render a JSON response, you can add the code from this code-snippet to your controller action -. #RubyOnRails
3
0
8
#RailsTips ๐ธ. Ready to explore more of ActiveSupport::Inflector?. Today we're introducing ordinal and ordinalize, great for formatting dates and times, rankings, or any numbers in a user-friendly way. Have a look - . #RubyOnRails
1
1
24
#RailsTips ๐ธ. Have you heard `assert_valid_keys` method from Hash class in Rails?. It provides easy way to validate the keys of hash against list of expected keys and raises error if hash contains any keys that are not included in the expected list -. #RubyOnRails #Rails
0
5
23
โจ RAILS PRO TIPS โจ. Take the habit of using pick(*column_names) instead of pluck(*column_names).first โจ๐ซ. #ruby #rubyonrails
0
0
2
#RailsTips ๐ธ. Today we'll explore another useful method from the Active Support::Inflector class: #parametrize. Convert any string to a URL-friendly format, great for generating slugs, file names, and SEO-friendly URLs. Check it out!. #RubyOnRails
0
0
11
Criando Rotas em Ruby on Rails: Passo a Passo.#RubyOnRails #DesenvolvimentoWeb #Programaรงรฃo #RailsTips #Codificaรงรฃo #Aprendizado #TechForBeginners #WebDevelopment #RotasEmRails #RailsBasics
1
0
0
#railstips. Interesting way to use `find_or_create_by` when you want to find by one parameter but create with additional parameters.
1
0
0
Add this snippet to auto-fix Ruby code style with RuboCop right after generating files (scaffold, models, etc.) in Rails. #RailsTips
0
1
16
Just added a small but mighty improvement to the tabs navigation on @railstips_dev - now you can effortlessly drag to scroll. Improving the user experience, one step at a time ๐
1
0
0
Save time & streamline your responses with #RubyOnRails' head method! Easily send HTTP status codes without extra content. Perfect for handling situations & errors gracefully. #RailsTips #CodingTips
0
1
3