<br />
<b>Deprecated</b>:  The each() function is deprecated. This message will be suppressed on further calls in <b>/home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php</b> on line <b>456</b><br />
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>eileen.codes</title>
    <description>&lt;h3&gt;About&lt;/h3&gt; &lt;p&gt;Hi, I&apos;m Eileen! I work at Shopify as a Senior Staff Software Engineer on the Ruby and Rails Infrastructure team. I love contributing to open source and speaking at conferences. I&apos;ve been a member of the Rails Core team since 2017 and the Ruby Core Committers team since 2024. I&apos;m passionate about making the open source world more welcoming and accessible, as well as improving performance, security, and scalability as applications grow.&lt;/p&gt;
</description>
    <link>http://eileencodes.com/</link>
    <atom:link href="http://eileencodes.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 06 Mar 2026 20:33:45 +0000</pubDate>
    <lastBuildDate>Fri, 06 Mar 2026 20:33:45 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Where Identity Begins: Becoming Eileen Alayce</title>
        <description>&lt;p&gt;The New Year often brings a rethinking of one’s habits, future, and identity. For me this year my future identity is more important than it ever was.&lt;/p&gt;

&lt;p&gt;Most of you don’t know that 2024 into 2025 was a deeply painful year for me. I wrote my 2024 Rails World keynote while my now ex-husband was moving out of the home we’d shared for 11 years. I put on a brave face and went to the conference. And even though it felt like my life was falling apart, I gave the best damn talk of my career. Being on stage reminded me that I’m strong, capable, and have a lot of support from the community. I’ll never forget the way my friends showed up for me that weekend.&lt;/p&gt;

&lt;p&gt;Now that I’m divorced and through the most difficult challenges, I’m rebuilding my identity, starting with a new last name - “Alayce”. The future I’m stepping into feels wider, brighter, and entirely my own.&lt;/p&gt;

&lt;p&gt;You may be wondering why I chose to create a new name instead of going back to my prior surname. After a lot of thought I decided I wanted a name that feels unique and exciting. I wanted a name to commemorate and represent my future life, the next chapter that I’ve entered. And most importantly I wanted a name that I will never ever be tempted to change again because this one is completely mine.&lt;/p&gt;

&lt;p&gt;Coming up with this name was a fun journey of trying on different last names until one felt right. I developed a set of rules to follow to make the elimination process more straightforward.&lt;/p&gt;

&lt;p&gt;The first last name I came up with was “Codes” because it’s already my identity online and professionally I’ve been “eileencodes” longer than I was married. It would be an easy shift that didn’t invite too many questions and wouldn’t give me an identity crisis. It fit into the criteria I set, but I tossed it out as an option because I didn’t want to tie my identity to my work. And while I love coding, I hope to have a long and happy life, and not feel like my entire life orbits solely around my work. “Ruby” was out for the same reason. I don’t think I need to explain why “Rails” was never in the running.&lt;/p&gt;

&lt;p&gt;From there I tried on “Lovelace” after Ada Lovelace, the first computer programmer. This also tied my identity to work, but in a more abstract way. I liked how it sounded with “Eileen” until I heard someone pronounce “Lovelace” as “Loveless”. The book “East of Eden” made me superstitious about names. I don’t want a loveless life and so I tossed this name out too.&lt;/p&gt;

&lt;p&gt;Every time I thought of a name, I’d try it on, say it out loud, write it down, use the web inspector to see it in the browser next to my photo online. I thought about where I lived and what I loved. I imagined using “Hudson” (for the river), “York” (for the state), or even the city I live in. I explored the names of places I love to travel to like  “Paris”, “Berlin”, and “Amsterdam”. I thought about the names of artists, poets, and musicians. Then the names of streets and colors and flowers. I thought of every word I have ever loved. I thought of “Arya”, my dog, and how I could incorporate her name. But while I love all these things, none of them felt like the name I should have always had.&lt;/p&gt;

&lt;p&gt;I started looking back in my family tree for names I might like - Grogan, Peabody, Crawford - but none felt right. I started to wonder: who could I honor without fully taking their name? I always felt a closeness to my maternal grandfather who passed away when I was in 5th grade. He loved technology and photography. He worked on the Hubble telescope (yes I even tried out “Hubble” too) and in many ways we were similar. I often wonder if he’d be proud of me and the life I’ve built.&lt;/p&gt;

&lt;p&gt;My grandfather’s original last name was “Sienkewicz”. This violated every single one of the rules I had set so that was obviously a no-go (I’m not even sure this is the correct spelling so it violated my “easy to spell over the phone” rule). After WW2 he changed his name to “Wallace”.&lt;/p&gt;

&lt;p&gt;I contemplated “Wallace” but it didn’t feel right so I started dismantling it to make a new name. First I dropped the “W” to get “Allace”. It felt like I was getting closer to a name I could love. I wanted it to be pronounced “Ah-lay-ce” not “All-aace”, so I dropped an “L” and got “Alace”. This felt more right, but it would likely get pronounced as  “Alice”. I then added a “y” to create “Alayce”. I played around with other spellings like “Alaice”, “Alasce”, “Alaece” but kept coming back to “Alayce”. I like the way it sounds, especially as “Eileen Alayce”. I enjoy writing it out, I appreciate the way it looks on paper and in print. And most importantly it meets all of the criteria I had set.&lt;/p&gt;

&lt;p&gt;I knew I had finally found the name that was always meant to be mine. I’ve sat with this new 	name for a while to make sure I didn’t change my mind. It’s been months and it still feels right. So now that the court system has approved it, it’s time to introduce myself to all of you.&lt;/p&gt;

&lt;p&gt;I want to take a moment to say how grateful I am for everyone who has supported me this past year. I don’t know if I’ll ever be able to express how much you all mean to me and how appreciative I am that you showed up for me. Thank you to my friends and family, sincerely. See you around the internet and hopefully in real life soon as “Eileen Alayce”. Here’s to writing our own stories and building a life we’re proud to thrive in.&lt;/p&gt;
</description>
        <pubDate>Fri, 06 Mar 2026 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/where-identity-begins/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/where-identity-begins/</guid>
        
        
        <category>life-updates</category>
        
      </item>
    
      <item>
        <title>The Case Against Monkey Patching</title>
        <description>&lt;p&gt;Monkey patching is considered one of the more powerful features of the Ruby programming language. However, by the end of this post I’m hoping to convince you that they should be used sparingly, if at all, because they are brittle, dangerous, and often unnecessary. I’ll also share tips on how to use them as safely as possible in the rare cases where you do need to monkey patch.&lt;/p&gt;

&lt;p&gt;Read more on the &lt;a href=&quot;https://shopify.engineering/the-case-against-monkey-patching&quot; target=&quot;_blank&quot;&gt;Shopify Engineering Blog&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Tue, 21 Feb 2023 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/the-case-against-monkey-patching/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/the-case-against-monkey-patching/</guid>
        
        
        <category>shopify</category>
        
      </item>
    
      <item>
        <title>Adding support for cross-cluster associations to Rails 7</title>
        <description>&lt;p&gt;At GitHub, we recently added a new feature to Rails that will be available in 7.0: support for handling associations across database clusters. Read about it on the &lt;a href=&quot;https://github.blog/2021-07-12-adding-support-cross-cluster-associations-rails-7/&quot;&gt;blog&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Mon, 12 Jul 2021 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/adding-support-cross-cluster-associations-rails-7/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/adding-support-cross-cluster-associations-rails-7/</guid>
        
        
        <category>github</category>
        
      </item>
    
      <item>
        <title>Upgrading GitHub to Ruby 2.7</title>
        <description>&lt;p&gt;Read about GitHub’s Ruby 2.7 upgrade at &lt;a href=&quot;https://github.blog/2020-08-25-upgrading-github-to-ruby-2-7/&quot;&gt;https://github.blog/2020-08-25-upgrading-github-to-ruby-2-7/&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Tue, 25 Aug 2020 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/upgrading-github-to-ruby-2-7/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/upgrading-github-to-ruby-2-7/</guid>
        
        
        <category>github</category>
        
      </item>
    
      <item>
        <title>Running GitHub on Rails 6.0</title>
        <description>&lt;p&gt;Read about GitHub’s Rails 6.0 upgrade at &lt;a href=&quot;https://github.blog/2019-09-09-running-github-on-rails-6-0/&quot;&gt;https://github.blog/2019-09-09-running-github-on-rails-6-0/&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Mon, 09 Sep 2019 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/running-github-on-rails-6-0/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/running-github-on-rails-6-0/</guid>
        
        
        <category>github</category>
        
      </item>
    
      <item>
        <title>Upgrading GitHub from 3.2 to 5.2</title>
        <description>&lt;p&gt;Read about GitHub’s Rails upgrade at &lt;a href=&quot;https://github.blog/2018-09-28-upgrading-github-from-rails-3-2-to-5-2/&quot;&gt;https://github.blog/2018-09-28-upgrading-github-from-rails-3-2-to-5-2/&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Wed, 26 Sep 2018 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/upgrading-github-from-3-2-to-5-2/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/upgrading-github-from-3-2-to-5-2/</guid>
        
        
        <category>github</category>
        
      </item>
    
      <item>
        <title>HTTP2 Early Hints</title>
        <description>&lt;p&gt;Update: The PR’s discussed in this blog post have been merged. You can try out Early Hints by using Rails and Puma master. You’ll need to also use Arel master until Rails 5.2 is released.&lt;/p&gt;

&lt;p&gt;Recently I’ve been working with &lt;a href=&quot;https://twitter.com/tenderlove&quot; target=&quot;_blank&quot;&gt;Aaron Patterson&lt;/a&gt; on implementing the HTTP2 Early Hints.&lt;/p&gt;

&lt;p&gt;The spec for Early Hints is still in &lt;a href=&quot;https://tools.ietf.org/html/draft-ietf-httpbis-early-hints-04&quot; target=&quot;_blank&quot;&gt;draft&lt;/a&gt; but explains the requirements for implementation. In order to start preparing Rails and Rack for HTTP2 we’ve implemented Early Hints handling in Puma and Rails.&lt;/p&gt;

&lt;p&gt;As of today (September 29, 2017) the pull requests haven’t been merged but we’d love for you to try them out if you’re interested in implementing Early Hints. A lot of this work is somewhat experimental so try it on production at your own risk.&lt;/p&gt;

&lt;p&gt;In this post I’ll go over what early hints are, what the spec expects, and finally how to use the two pull requests to test it out on your own application.&lt;/p&gt;

&lt;h3 id=&quot;early-hints-what-huh&quot;&gt;Early Hints, what huh?&lt;/h3&gt;

&lt;p&gt;Early Hints is a new HTTP status code that allows your application to send links to assets that you would like to load early. For example if you have a stylesheet and javascript file included in your Rails application you may want to tell the client about them early so it can start downloading them.&lt;/p&gt;

&lt;p&gt;The Early Hints spec contains header Links with references to those resources that you need downloaded early. An example response from the server looks like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; HTTP/1.1 103 Early Hints
 Link: &amp;lt;/style.css&amp;gt;; rel=preload; as=style
 Link: &amp;lt;/script.js&amp;gt;; rel=preload; as=script

 HTTP/1.1 200 OK
 Date: Fri, 26 May 2017 10:02:11 GMT
 Content-Length: 1234
 Content-Type: text/html; charset=utf-8
 Link: &amp;lt;/style.css&amp;gt;; rel=preload; as=style
 Link: &amp;lt;/script.js&amp;gt;; rel=preload; as=script
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are 2 responses, one for Early Hints that sends the linked resources and one for the final request that should also include the same links.&lt;/p&gt;

&lt;p&gt;For the Link header, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Link: &amp;lt;/style.css&amp;gt;; rel=preload; as=style&lt;/code&gt; the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;style.css&lt;/code&gt; is the path to the css file, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rel&lt;/code&gt; does not change and should be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;preload&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;as&lt;/code&gt; is the type of resource you’re sending. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;as&lt;/code&gt; is not required, but is useful for content-security policies.&lt;/p&gt;

&lt;p&gt;While HTTP/1.1 &lt;em&gt;can&lt;/em&gt; accept a 103, a server might not actually send the hints unless it absolutely knows they will be accepted. HTTP/2 is less likely to have this problem as handling of response headers doesn’t affect how the response body is determined (as noted in the spec.&lt;/p&gt;

&lt;h3 id=&quot;implementing-early-hints-with-puma-and-rails&quot;&gt;Implementing Early Hints with Puma and Rails&lt;/h3&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/puma/puma/pull/1403&quot; target=&quot;_blank&quot;&gt;Puma PR&lt;/a&gt; and &lt;a href=&quot;https://github.com/rails/rails/pull/30744&quot; target=&quot;_blank&quot;&gt;Rails PR&lt;/a&gt; are both a work in progress so they are likely to change before we merge them into their respective projects.&lt;/p&gt;

&lt;p&gt;Below I’ll describe how you can try these two out in your Rails app. First make sure you’re using the Rails and Puma gems set to the branch for these PRs’&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Gemfile

gem &apos;rails&apos;, git: &apos;https://github.com/eileencodes/rails&apos;, branch: &apos;early-hints&apos;
gem &apos;puma&apos;, git: &apos;https://github.com/eileencodes/puma&apos;, branch: &apos;early-hints&apos;
gem &apos;arel&apos;, git: &apos;https://github.com/rails/arel&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next you’ll need a proxy that can handle HTTP/2.&lt;/p&gt;

&lt;p&gt;Install &lt;a href=&quot;https://github.com/h2o/h2o&quot; target=&quot;_blank&quot;&gt;h2o&lt;/a&gt; via homebrew or the method you need for your computer. I used homebrew with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;brew install h2o&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Find the h2o config file (mine is in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/local/etc/h2o/h2o.conf&lt;/code&gt; and update it with the following:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hosts:
  &quot;localhost&quot;:
    listen:
      port: 9090
      ssl:
        certificate-file: /usr/local/etc/h2o/localhost.crt
        key-file: /usr/local/etc/h2o/localhost.key
    paths:
      &quot;/&quot;:
        proxy.reverse.url: &quot;http://127.0.0.1:3000/&quot;

access-log: /usr/local/var/h2o/access-log
error-log: /usr/local/var/h2o/error-log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next you’ll need a “fake” certificate so you can do HTTPS requests with localhost. Otherwise Early Hints won’t work. See &lt;a href=&quot;http://kokizzu.blogspot.com/2015/02/how-to-install-h2o-http2-web-server.html&quot; target=&quot;_blank&quot;&gt;this post&lt;/a&gt; for more information on the following.&lt;/p&gt;

&lt;p&gt;Run this command:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -out localhost.crt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And follow the prompts. I hit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;enter&lt;/code&gt; for everything. Then move your certificate and key into your h2o folder since that’s where the config is looking. If you want the cert to live somewhere else, update your h2o.conf with that new path.&lt;/p&gt;

&lt;p&gt;Now start the h2o server with the config: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;h2o -c h2o/h2o.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And start your Rails server (if it’s a Rails 5 app you will automatically be using Puma. This will not work if you’re not using the Puma branch I linked above): &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bin/rails s --early-hints&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open Chrome and go to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://localhost:9090/someurl&lt;/code&gt; replacing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;someurl&lt;/code&gt; with a URL you know uses a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;javascript_include_tag&lt;/code&gt; or a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stylesheet_link_tag&lt;/code&gt; because that’s the way Early Hints is currently implemented in Rails.&lt;/p&gt;

&lt;p&gt;Open the Chrome dev tools and go to the network tab. From there you should see &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Push / posts&lt;/code&gt;  where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;posts&lt;/code&gt; is the URL you entered under the “Initiator” column. Below is a screenshot of my Chrome dev tools showing the Early Hints loading. If you click the image to load the full side it is easier to view.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/early_hints.png&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/assets/early_hints.png&quot; alt=&quot;Early Hints Chrome Browser with Rails and Puma&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 29 Sep 2017 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/http2-early-hints/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/http2-early-hints/</guid>
        
        
        <category>new-features</category>
        
        <category>open-source</category>
        
      </item>
    
      <item>
        <title>My Process for Writing a Talk</title>
        <description>&lt;p&gt;There’s a ton of blog posts out there with advice on how to write talks. They all discuss the “right way”, but in reality I don’t think anyone follows a process prescribed by someone else.&lt;/p&gt;

&lt;p&gt;I’m a very visual person and in a way I write talks backwards. “The right way” would be to write copy and then build the slides around it. I shouldn’t even be opening Keynote until I have solid, well-articulated copy. But that’s not how I’ve been writing talks.&lt;/p&gt;

&lt;p&gt;I’m definitely not recommending you follow my way of doing things, but I thought it would be fun to share my process. I’ve developed approximately 6 talks between meetups and conferences. I put a lot of time and effort into each one. My &lt;a href=&quot;http://eileencodes.com/speaking/#how-to-performance&quot;&gt;How to Performance&lt;/a&gt; talk was probably 100-120+ hours depending on if you count revisions and practice I did before each conference.&lt;/p&gt;

&lt;p&gt;Here’s my process:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Talk to anyone who will listen about something I’m passionate about or working on recently. The talk I’m currently writing is about Security. I’ve ranted and explained all sort of things I believe about security and patching applications to anyone who will listen; my dog, my husband, my friends and coworkers. If I keep talking about it enough, I know I care about it enough to turn it into a talk.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Collect ideas in a Google doc so I can access the file anywhere.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Come up with a title (see I told you this was backwards because this is “supposed to” be after an abstract)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Write an abstract.&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;Write something, anything down that resembles a beginning, middle and end of an abstract&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Show it to my husband who tells me how to write a better one&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;State that I can’t do this, I don’t know how to do this
&lt;img src=&quot;/assets/table_flip.jpg&quot; alt=&quot;Table flip&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Go to the gym and work out my frustration&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;Come back and bang out a kick-ass abstract&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Write an outline. This is where it starts to get weird.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Open Keynote and pick colors. Colors are very important to me. I was a photography major and have a design and art background. If the colors don’t feel right I can’t write the talk.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Collect memes and gifs to help express myself.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Build out the middle slides; the meat. This is generally where I start adding all the gifs I’ve saved over the past couple months that I think would go great with sentiments I have in the talk.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Freak out that this talk isn’t going well and it will never be good. I’ve given 3 well liked talks at 8 conferences and I still believe they were a one-hit wonder and no one will like any future talks. This is something I deal with every time, and it’s hard. It’s difficult to tell yourself you’re going to be fine. That’s why it’s good to have a great support system of family and friends who will help pull your head out of your ass so you can keep working.
&lt;img src=&quot;/assets/crying.gif&quot; alt=&quot;Crying&quot; style=&quot;margin:20px;&quot; /&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Start writing copy for the beginning slides I never added. Add slides to fill in the opening of the talk as I write them.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Write the copy for the ending slides I never added. Add slides to fill in the end of the talk as I write them.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Go back to the middle slides and write the copy for those adding, removing, and reordering slides as necessary. Once I’m satisfied the talk is “written” I go back and edit copy. Written to me just means I could go give this talk as is and it would be complete, but confusing. It’s not perfect but all my main points are in there.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Give talk at a local meetup.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Make changes based on the meetup feedback.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Practice. Edit. Practice. Every night for 2-3 weeks leading up to the conference.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Give talk at a conference.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Make changes based on things I felt were confusing and based on questions/feedback I get.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Repeat 15-17 until I retire the talk.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/assets/rabbit.jpg&quot; alt=&quot;Rinse and repeat&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This process, while convoluted at points, is my process. This works for me. Don’t let anyone tell you you’re doing it wrong. It’s your talk. If you a) get up and actually do it or b) people find your talk interesting, then you were successful. Find what works for you and what gets you up there on that stage. That’s all the matters.&lt;/p&gt;

&lt;p&gt;I’m giving talks at 4 conferences so far this year. Mountain West Ruby Conference in March, Twilio’s SignalConf in May, Brighton Ruby Conference in July, and AbstractionsConf in August. You can always find what conferences I’ll be at on my &lt;a href=&quot;http://eileencodes.com/speaking&quot;&gt;speaking&lt;/a&gt; page.&lt;/p&gt;

</description>
        <pubDate>Sat, 27 Feb 2016 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/my-process-for-writing-a-talk/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/my-process-for-writing-a-talk/</guid>
        
        
        <category>conferences</category>
        
        <category>opinion</category>
        
        <category>tips</category>
        
      </item>
    
      <item>
        <title>Rails 5: The Sprockets 4 Manifest</title>
        <description>&lt;aside&gt;As we work towards the release of Rails 5 there are a lot of changes will affect your application when you choose to upgrade. To help you keep up with the rapid development and changes I&apos;m starting a series of blog posts to help you be ready to upgrade when that time comes.&lt;/aside&gt;

&lt;p&gt;When Rails 5 is released it will require that you upgrade to Sprockets 4. Sprockets 4 has some big changes in how it knows what assets to compile so you will definitely have some updates to make if you rely on Sprockets within Rails. Since there are a lot of changes in Sprockets 4 I’ll just be talking about the new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.js&lt;/code&gt; in this post.&lt;/p&gt;

&lt;p&gt;With Sprockets you used to tell your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;config/initializers/assets.rb&lt;/code&gt; what assets were supposed to be precompiled. In Sprockets 4 you will use a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.js&lt;/code&gt; inside your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;app/assets/&lt;/code&gt; directory to tell Sprockets what assets to precompile. This behavior is actually available to use in Sprockets 3 but &lt;a href=&quot;https://github.com/rails/sprockets-rails/blob/93a45b1c463a063ec7cf4d160107b67aa3db7a1a/lib/sprockets/railtie.rb#L77-L81&quot; target=&quot;_blank&quot;&gt;sprockets-rails&lt;/a&gt; has a conditional that only activates this in Sprockets 4.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# sprockets-rails/lib/sprockets/railtie.rb&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;using_sprockets4?&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;precompile&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%w( manifest.js )&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;precompile&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;LOOSE_APP_ASSETS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/(?:\/|\\|\A)application\.(css|js)$/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;i&gt;Note: the file type that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.js&lt;/code&gt; is stored as may change. There is disucssion around moving the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.js&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.yml&lt;/code&gt; because it doesn’t make sense that the manifest has a file type that is unrelated to it’s usage.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;So, how do you use a the new manifest file? In your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;app/assets/&lt;/code&gt; directory add a new directory named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;config/&lt;/code&gt;. Inside that folder add a file called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.js&lt;/code&gt; you’ll want to link your JS and CSS directories as well as any other directories you rely on like images, fonts, sounds etc.&lt;/p&gt;

&lt;p&gt;Here is an example of a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;manifest.js&lt;/code&gt; that links JS, CSS, fonts, and images.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// JS and CSS bundles&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//= link_directory ../javascripts .js&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//= link_directory ../stylesheets .css&lt;/span&gt;


&lt;span class=&quot;c1&quot;&gt;// Images and fonts so that views can link to them&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//= link_tree ../fonts&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//= link_tree ../images&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Previously you didn’t need to include fonts and images in your precompiled assets list and Sprockets Rails would use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LOOSE_APP_ASSETS&lt;/code&gt; constant to figure out those items, but now you have to explicitly include them in your config.&lt;/p&gt;

&lt;p&gt;You’ll notice that we use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;link_directory&lt;/code&gt; for CSS and JS, then the path from the config manifest file to the javascript “file”. We compile &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.coffee&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.scss&lt;/code&gt; down to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.js&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.css&lt;/code&gt;, respectively, so we denote that after the path to the JS and CSS files to tell Sprockets what to compile them into. Images and fonts don’t change file type when compiled.&lt;/p&gt;

&lt;p&gt;Once you’ve done that you’ll need to remove &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;config.assets.precompile&lt;/code&gt; from your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;config/initializers/assets.rb&lt;/code&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;precompile&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%w( 
  all.css all.js
)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Smaller apps may only have the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;precompile&lt;/code&gt; directive in their applications so in that case you can delete the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;config/initializers/assets.rb&lt;/code&gt; file. For larger apps, like Basecamp we have some extra settings regarding assets and didn’t want to delete the config file.&lt;/p&gt;
</description>
        <pubDate>Wed, 11 Nov 2015 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/the-sprockets-4-manifest/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/the-sprockets-4-manifest/</guid>
        
        
        <category>rails-5</category>
        
      </item>
    
      <item>
        <title>Rails 5: ActionController::Parameters Now Returns an Object Instead of a Hash</title>
        <description>&lt;aside&gt;As we work towards the release of Rails 5 there are a lot of changes will affect your application when you choose to upgrade. To help you keep up with the rapid development and changes I&apos;m starting a series of blog posts to help you be ready to upgrade when that time comes.&lt;/aside&gt;

&lt;p&gt;A big change coming is how &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ActionController::Parameters&lt;/code&gt; works. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ActionController::Parameters&lt;/code&gt; is where all of your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;params&lt;/code&gt; come from for your controllers. Calling &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;params&lt;/code&gt; used to return a hash, but now will return an object.&lt;/p&gt;

&lt;p&gt;Note: this doesn’t affect accessing the keys in the params hash like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;params[:id]&lt;/code&gt;. You can view the PR that implemented this change here: &lt;a href=&quot;https://github.com/rails/rails/pull/20868&quot; target=&quot;_blank&quot;&gt;https://github.com/rails/rails/pull/20868&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To access the parameters in the object you can add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#to_h&lt;/code&gt; to the parameters:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to_h&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If those params aren’t explictly permitted you will be returned a hash with only the permitted parameters. If none are permitted you’ll get an empy hash (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{}&lt;/code&gt;). This comes in where you may be running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#symbolize_keys&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#slice&lt;/code&gt; on unpermitted &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;params&lt;/code&gt;. If you’re accessing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;params&lt;/code&gt; that aren’t being saved to a model/db then you probably aren’t explictly permitting those parameters.&lt;/p&gt;

&lt;p&gt;If we look at the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#to_h&lt;/code&gt; method in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ActionController::Parameters&lt;/code&gt; we can see it checks if the parameters are permitted before converting them to a hash.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# actionpack/lib/action_controller/metal/strong_parameters.rb&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;to_h&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;permitted?&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@parameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to_h&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;always_permitted_parameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;permit!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to_h&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Let’s take an example where we are slicing params to use later. If we have this method that slices params we used to be able to write:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;do_something_with_params&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:param_1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:param_2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Which would return:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:param_1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:param_2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;But now that will return an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ActionController::Parameters&lt;/code&gt; object.&lt;/p&gt;

&lt;p&gt;Calling &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#to_h&lt;/code&gt; on this would return an empty hash because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;param_1&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;param_2&lt;/code&gt; aren’t permitted.&lt;/p&gt;

&lt;p&gt;To get access to the params from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ActionController::Parameters&lt;/code&gt; you need to first permit the params and then call &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#to_h&lt;/code&gt; on the object. The following returns the same thing as slice did previously.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;do_something_with_params&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;permit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:param_1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:param_2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to_h&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Another way to do this would be to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#to_unsafe_hash&lt;/code&gt; if you know the params are not user supplied and are safe:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;do_something_with_params&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to_unsafe_h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:param_1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:param_2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;By default &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;controller&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;action&lt;/code&gt; parameters are allowed. To explicitly always allow other parameters you can set a configuration option in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;application.rb&lt;/code&gt; that allows those parameters. Note: this will return the hash with string keys, not symbol keys.&lt;/p&gt;

&lt;p&gt;Config option:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;  &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;always_permitted_parameters&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%w( controller action param_1 param_2 )&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Calling slice on the parameters:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;do_something_with_params&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;param_1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;param_2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to_h&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If you’re not sure when you’ll have time to upgrade it would be a good idea to write some tests for your controllers that access the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;params&lt;/code&gt;. That way when you do upgrade you’ll know to fix the params because your tests will be failing.&lt;/p&gt;
</description>
        <pubDate>Sun, 20 Sep 2015 00:00:00 +0000</pubDate>
        <link>http://eileencodes.com/posts/actioncontroller-parameters-now-returns-an-object-instead-of-a-hash/</link>
        <guid isPermaLink="true">http://eileencodes.com/posts/actioncontroller-parameters-now-returns-an-object-instead-of-a-hash/</guid>
        
        
        <category>rails-5</category>
        
      </item>
    
  </channel>
</rss>
