はてなブックマークアプリ

サクサク読めて、
アプリ限定の機能も多数!

アプリで開く

はてなブックマーク

  • はてなブックマークって?
  • アプリ・拡張の紹介
  • ユーザー登録
  • ログイン
  • Hatena

はてなブックマーク

トップへ戻る

  • 総合
    • 人気
    • 新着
    • IT
    • 最新ガジェット
    • 自然科学
    • 経済・金融
    • おもしろ
    • マンガ
    • ゲーム
    • はてなブログ(総合)
  • 一般
    • 人気
    • 新着
    • 社会ニュース
    • 地域
    • 国際
    • 天気
    • グルメ
    • 映画・音楽
    • スポーツ
    • はてな匿名ダイアリー
    • はてなブログ(一般)
  • 世の中
    • 人気
    • 新着
    • 新型コロナウイルス
    • 働き方
    • 生き方
    • 地域
    • 医療・ヘルス
    • 教育
    • はてな匿名ダイアリー
    • はてなブログ(世の中)
  • 政治と経済
    • 人気
    • 新着
    • 政治
    • 経済・金融
    • 企業
    • 仕事・就職
    • マーケット
    • 国際
    • はてなブログ(政治と経済)
  • 暮らし
    • 人気
    • 新着
    • カルチャー・ライフスタイル
    • ファッション
    • 運動・エクササイズ
    • 結婚・子育て
    • 住まい
    • グルメ
    • 相続
    • はてなブログ(暮らし)
    • 掃除・整理整頓
    • 雑貨
    • 買ってよかったもの
    • 旅行
    • アウトドア
    • 趣味
  • 学び
    • 人気
    • 新着
    • 人文科学
    • 社会科学
    • 自然科学
    • 語学
    • ビジネス・経営学
    • デザイン
    • 法律
    • 本・書評
    • 将棋・囲碁
    • はてなブログ(学び)
  • テクノロジー
    • 人気
    • 新着
    • IT
    • セキュリティ技術
    • はてなブログ(テクノロジー)
    • AI・機械学習
    • プログラミング
    • エンジニア
  • おもしろ
    • 人気
    • 新着
    • まとめ
    • ネタ
    • おもしろ
    • これはすごい
    • かわいい
    • 雑学
    • 癒やし
    • はてなブログ(おもしろ)
  • エンタメ
    • 人気
    • 新着
    • スポーツ
    • 映画
    • 音楽
    • アイドル
    • 芸能
    • お笑い
    • サッカー
    • 話題の動画
    • はてなブログ(エンタメ)
  • アニメとゲーム
    • 人気
    • 新着
    • マンガ
    • Webマンガ
    • ゲーム
    • 任天堂
    • PlayStation
    • アニメ
    • バーチャルYouTuber
    • オタクカルチャー
    • はてなブログ(アニメとゲーム)
    • はてなブログ(ゲーム)
  • おすすめ

    ブラックフライデー

『Justin Weiss』

  • 人気
  • 新着
  • すべて
  • The lesser-known features in Rails 5.1

    4 users

    www.justinweiss.com

    Last week, during RailsConf 2017, Rails 5.1 shipped. If you followed the announcements, you’ve seen the big features: better integration with modern JavaScript, encrypted secrets, and system tests. And there’s my personal favorite: finally getting rid of the weird combo of form_for and form_tag, and replacing it with form_with. I can’t wait to try it. But the reason I love Rails isn’t the big new

    • テクノロジー
    • 2017/05/03 08:12
    • Rails
    • How Rails sessions work

      5 users

      www.justinweiss.com

      How Rails Sessions Work What if your Rails app couldn’t tell who was visiting it? If you had no idea that the same person requested two different pages? If all the data you stored vanished as soon as you returned a response? That might be fine for a mostly static site. But most apps need to be able to store some data about a user. Maybe it’s a user id, or a preferred language, or whether they alwa

      • テクノロジー
      • 2016/11/09 18:35
      • session
      • rails
      • How to preload Rails scopes

        5 users

        www.justinweiss.com

        This article is also available in Korean, thanks to Soonsang Hong! Rails’ scopes make it easy to find the records you want: app/models/review.rbclass Review < ActiveRecord::Base belongs_to :restaurant scope :positive, -> { where("rating > 3.0") } end irb(main):001:0> Restaurant.first.reviews.positive.count Restaurant Load (0.4ms) SELECT `restaurants`.* FROM `restaurants` ORDER BY `restaurants`.`id

        • テクノロジー
        • 2016/08/09 16:41
        • rails
        • performance
        • 4 simple memoization patterns in Ruby (and one gem)

          11 users

          www.justinweiss.com

          4 Simple Memoization Patterns in Ruby (And One Gem) Memoization is a technique you can use to speed up your accessor methods. It caches the results of methods that do time-consuming work, work that only needs to be done once. In Rails, you see memoization used so often that it even included a module that would memoize methods for you. Later, this was controversially removed in favor of just using

          • テクノロジー
          • 2016/07/22 15:51
          • Ruby
          • Rails
          • How does Rails handle gems?

            3 users

            www.justinweiss.com

            How Does Rails Handle Gems? A few weeks ago, I wrote about how RubyGems manages Ruby’s load path. But Rails doesn’t use RubyGems directly – it uses Bundler to manage its gems. If you don’t know how Bundler works, the way gems get pulled into Rails might seem a little too magical. How does adding a line to a Gemfile get code into your app? How do Bundler, Rails, and RubyGems work together to make h

            • テクノロジー
            • 2016/03/06 17:55
            • Rails 5, Module#prepend, and the end of `alias_method_chain`

              5 users

              www.justinweiss.com

              Rails 5, Module#prepend, and the End of `Alias_method_chain` The Rails 4.2 announcement had some interesting news about the upcoming Rails 5: It’s probably going to require Ruby 2.2. Which will make it the first Rails version to take advantage of all the good stuff from Ruby 2. The post mentioned garbage collected symbols and keyword arguments. But to me, one of the most interesting Ruby 2 feature

              • テクノロジー
              • 2016/01/19 13:35
              • Rails
              • ruby
              • A web server vs. an app server

                7 users

                www.justinweiss.com

                When you research how to deploy your Rails app, you’ll see a lot of names: Apache, Unicorn, Puma, Phusion Passenger, Nginx, Rainbows, and many more. They all seem to fit under the “deploying Rails” category of software, but there’s a key difference between them. Some are “web servers,” and others are “app servers.” Once you understand which is which, and where each category fits in your system, de

                • テクノロジー
                • 2015/10/28 13:19
                • サーバ
                • server
                • rails
                • Creating easy, readable attributes with ActiveRecord enums

                  3 users

                  www.justinweiss.com

                  Imagine a question that can be either “pending”, “approved”, or “flagged”. Or a phone number that’s a “home”, “office”, “mobile”, or “fax” (if it’s 1982). Some models call for this kind of data. An attribute that can have only one of a few different values. And that set of values almost never changes. It’s a situation where, if it were plain Ruby, you’d just use a symbol. You could create a PhoneN

                  • テクノロジー
                  • 2015/10/20 14:32
                  • enum
                  • rails
                  • あとで読む
                  • A new way to understand your Rails app's performance

                    3 users

                    www.justinweiss.com

                    A New Way to Understand Your Rails App's Performance Is your Rails app slow? When it takes seconds to load what should be a simple view, you have a problem worth digging into. You could have too many database calls or some slow methods. Or maybe it’s that speedup loop someone put in your code and forgot about. You can find lots of tools to help you find out what’s slowing your app down. A few week

                    • テクノロジー
                    • 2015/05/20 21:58
                    • performance
                    • Rails
                    • What's the difference between `irb`, `bundle exec irb`, `bundle console`, and `rails console`?

                      4 users

                      www.justinweiss.com

                      What's the Difference Between `Irb`, `Bundle Exec Irb`, `Bundle Console`, and `Rails Console`? There are a lot of ways to launch a Ruby or Rails console: irb, bundle exec irb, bundle console, and rails console are some of the most common. They seem similar, but they each work a little bit differently. If you don’t know what those differences are, you’ll have some problems. Maybe you won’t be able

                      • テクノロジー
                      • 2015/04/16 23:35
                      • Rails
                      • How to debug Ruby performance problems in production

                        6 users

                        www.justinweiss.com

                        How to Debug Ruby Performance Problems in Production You know that performance is a feature. And a lot of performance problems can be found and fixed during development. But what about those slowdowns that only show up in production? Do you have to add log messages to every single line of code? That would just slow things down even more! Or do you ship tons of tiny “maybe this fixes it” commits to

                        • テクノロジー
                        • 2015/04/09 13:48
                        • performance
                        • Rails
                        • ruby
                        • あとで読む
                        • How Rails sessions work

                          8 users

                          www.justinweiss.com

                          How Rails Sessions Work What if your Rails app couldn’t tell who was visiting it? If you had no idea that the same person requested two different pages? If all the data you stored vanished as soon as you returned a response? That might be fine for a mostly static site. But most apps need to be able to store some data about a user. Maybe it’s a user id, or a preferred language, or whether they alwa

                          • テクノロジー
                          • 2015/03/19 03:44
                          • Rails
                          • pocket
                          • How to upgrade to Rails 4.2

                            4 users

                            www.justinweiss.com

                            How to Upgrade to Rails 4.2 Upgrading some Rails apps is as easy as bundle update rails. But what if you have one of the other kind of apps? The ones that are still on Rails 4.0, or even 3.2, because you didn’t feel like dragging them kicking and screaming into the future? Whether you’re facing a quick upgrade or a painful one, these steps will help you get your app to Rails 4.2 as smoothly as pos

                            • テクノロジー
                            • 2015/01/30 08:19
                            • rails
                            • 3 ways to monkey-patch without making a mess

                              4 users

                              www.justinweiss.com

                              3 Ways to Monkey-Patch Without Making a Mess Monkey Patching. When you first try Ruby, it’s amazing. You can add methods right to core classes! You don’t have to call Time.now.advance(days: -1), you can write 1.day.ago! It makes Ruby a joy to read and write. Until… You hit weird bugs because a patch changed Hash. You get confused about which code actually ran, so you can’t debug it when it breaks.

                              • テクノロジー
                              • 2015/01/21 07:03
                              • Ruby
                              • あとで読む
                              • Better globals with a tiny ActiveSupport module

                                4 users

                                www.justinweiss.com

                                Better Globals With a Tiny ActiveSupport Module Generally, global variables are bad. But sometimes, a global in the right place can make your code a lot simpler. In Rails, you might set data once during a request, but use it in every layer of your app. Which user is making the request? What permissions do they have? Which database connection should be used? This information should be available thr

                                • テクノロジー
                                • 2014/12/08 15:35
                                • rails
                                • Performance
                                • Ruby
                                • `respond_to` without all the pain

                                  3 users

                                  www.justinweiss.com

                                  `Respond_to` Without All the Pain When you generate a scaffold in Rails, you’ll see the usual respond_to blocks: app/controllers/tasks_controller.rb def destroy @task.destroy respond_to do |format| format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' } format.json { head :no_content } end end But some of your actions, like index, don’t have them! app/controllers/tasks_co

                                  • テクノロジー
                                  • 2014/11/16 15:47
                                  • rails
                                  • `respond_to` without all the pain

                                    4 users

                                    www.justinweiss.com

                                    `Respond_to` Without All the Pain When you generate a scaffold in Rails, you’ll see the usual respond_to blocks: app/controllers/tasks_controller.rb def destroy @task.destroy respond_to do |format| format.html { redirect_to tasks_url, notice: 'Task was successfully destroyed.' } format.json { head :no_content } end end But some of your actions, like index, don’t have them! app/controllers/tasks_co

                                    • テクノロジー
                                    • 2014/11/09 17:44
                                    • Rails
                                    • Practicing Rails: Learn Rails Without Getting Overwhelmed

                                      8 users

                                      www.justinweiss.com

                                      “The goal of Ruby is to make programmers happy. So why do I have to slog through 400 pages on RSpec and Capybara and Bootstrap and Sass before I can write a simple blog?” You’re on your second Rails tutorial, and you feel like flipping a table. Writing a Rails app is supposed to be easy, right? But even if you’ve seen all the pieces, you don’t know how they fit together. Everywhere you look there’

                                      • テクノロジー
                                      • 2014/10/27 14:57
                                      • Rails
                                      • ebook
                                      • Justin Weiss

                                        10 users

                                        www.justinweiss.com

                                        If you want to write great Rails apps, there’s a lot you’ll need to know. Sometimes, it feels impossible to keep up. But if you don’t seek out new knowledge, you’ll fall behind. You don’t have to dig for great Rails information, if it finds you. Read on, and you’ll learn how to speed up your apps, discover new Rails features, create more effective tests, write code more quickly, and become a bette

                                        • テクノロジー
                                        • 2014/10/09 09:27
                                        • Ruby
                                        • development
                                        • programming
                                        • あとで読む
                                        • Rails 5, Module#prepend, and the end of `alias_method_chain`

                                          9 users

                                          www.justinweiss.com

                                          Rails 5, Module#prepend, and the End of `Alias_method_chain` The Rails 4.2 announcement had some interesting news about the upcoming Rails 5: It’s probably going to require Ruby 2.2. Which will make it the first Rails version to take advantage of all the good stuff from Ruby 2. The post mentioned garbage collected symbols and keyword arguments. But to me, one of the most interesting Ruby 2 feature

                                          • テクノロジー
                                          • 2014/09/12 02:10
                                          • rails
                                          • Ruby
                                          • The lesser-known features in Rails 4.2

                                            4 users

                                            www.justinweiss.com

                                            The Lesser-Known Features in Rails 4.2 The first beta of Rails 4.2 was announced last week, and it already looks amazing. I’m really excited to use ActiveJob, Web Console, Adequate Record, and Foreign Key support in my own apps. But the beauty of Rails is in the details. And if you do a little digging, you’ll find some less advertised features that will totally improve your daily work with Rails.

                                            • テクノロジー
                                            • 2014/08/27 16:09
                                            • rails
                                            • 4 simple memoization patterns in Ruby (and one gem)

                                              10 users

                                              www.justinweiss.com

                                              4 Simple Memoization Patterns in Ruby (And One Gem) Memoization is a technique you can use to speed up your accessor methods. It caches the results of methods that do time-consuming work, work that only needs to be done once. In Rails, you see memoization used so often that it even included a module that would memoize methods for you. Later, this was controversially removed in favor of just using

                                              • テクノロジー
                                              • 2014/07/30 14:24
                                              • ruby
                                              • Search and filter Rails models without bloating your controller

                                                5 users

                                                www.justinweiss.com

                                                Search and Filter Rails Models Without Bloating Your Controller Searching, sorting, and filtering in Rails controllers can be a pain. ElasticSearch and Solr are great, high-powered solutions, but are really big dependencies for a small app. Luckily, Rails includes scopes, which can provide you with a lot of what you need for simple searching, filtering, and sorting. If you take advantage of scope

                                                • テクノロジー
                                                • 2014/03/12 01:32
                                                • Rails
                                                • Search and filter Rails models without bloating your controller

                                                  8 users

                                                  www.justinweiss.com

                                                  Search and Filter Rails Models Without Bloating Your Controller Searching, sorting, and filtering in Rails controllers can be a pain. ElasticSearch and Solr are great, high-powered solutions, but are really big dependencies for a small app. Luckily, Rails includes scopes, which can provide you with a lot of what you need for simple searching, filtering, and sorting. If you take advantage of scope

                                                  • テクノロジー
                                                  • 2014/02/21 00:21
                                                  • rails
                                                  • search

                                                  このページはまだ
                                                  ブックマークされていません

                                                  このページを最初にブックマークしてみませんか?

                                                  『Justin Weiss』の新着エントリーを見る

                                                  キーボードショートカット一覧

                                                  j次のブックマーク

                                                  k前のブックマーク

                                                  lあとで読む

                                                  eコメント一覧を開く

                                                  oページを開く

                                                  はてなブックマーク

                                                  • 総合
                                                  • 一般
                                                  • 世の中
                                                  • 政治と経済
                                                  • 暮らし
                                                  • 学び
                                                  • テクノロジー
                                                  • エンタメ
                                                  • アニメとゲーム
                                                  • おもしろ
                                                  • アプリ・拡張機能
                                                  • 開発ブログ
                                                  • ヘルプ
                                                  • お問い合わせ
                                                  • ガイドライン
                                                  • 利用規約
                                                  • プライバシーポリシー
                                                  • 利用者情報の外部送信について
                                                  • ガイドライン
                                                  • 利用規約
                                                  • プライバシーポリシー
                                                  • 利用者情報の外部送信について

                                                  公式Twitter

                                                  • 公式アカウント
                                                  • ホットエントリー

                                                  はてなのサービス

                                                  • はてなブログ
                                                  • はてなブログPro
                                                  • 人力検索はてな
                                                  • はてなブログ タグ
                                                  • はてなニュース
                                                  • ソレドコ
                                                  • App Storeからダウンロード
                                                  • Google Playで手に入れよう
                                                  Copyright © 2005-2025 Hatena. All Rights Reserved.
                                                  設定を変更しましたx