<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: shaan-erickson</title>
    <description>The latest articles on DEV Community by shaan-erickson (@shaanerickson).</description>
    <link>https://dev.to/shaanerickson</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1001344%2Fe18fde35-8e04-4b31-8082-d7cecef950fc.png</url>
      <title>DEV Community: shaan-erickson</title>
      <link>https://dev.to/shaanerickson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaanerickson"/>
    <language>en</language>
    <item>
      <title>Homework 3 questions</title>
      <dc:creator>shaan-erickson</dc:creator>
      <pubDate>Tue, 24 Jan 2023 02:20:32 +0000</pubDate>
      <link>https://dev.to/shaanerickson/homework-3-questions-p9a</link>
      <guid>https://dev.to/shaanerickson/homework-3-questions-p9a</guid>
      <description>&lt;p&gt;Q: What is &lt;code&gt;on: :member&lt;/code&gt; when defining a custom route?&lt;/p&gt;

</description>
      <category>htmx</category>
      <category>react</category>
      <category>go</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Questions on W2 homework</title>
      <dc:creator>shaan-erickson</dc:creator>
      <pubDate>Sun, 15 Jan 2023 18:36:07 +0000</pubDate>
      <link>https://dev.to/shaanerickson/questions-on-w2-homework-28gj</link>
      <guid>https://dev.to/shaanerickson/questions-on-w2-homework-28gj</guid>
      <description>&lt;p&gt;Q: What does adding &lt;code&gt;index: true&lt;/code&gt; do in a migration file? It allows the database to be sorted/filtered for that column, but couldn't we do that anyway? For example, we added that to the photos migration this week to allow us to look up photos by their owner_id, but couldn't we do that anyway with a &lt;code&gt;.Where&lt;/code&gt;? &lt;/p&gt;

&lt;p&gt;Q: When we link to the "posts" page (or any other), we include &lt;code&gt;@user.username&lt;/code&gt; in the arguments to the path (e.g. &lt;code&gt;&amp;lt;%= link_to "Posts", user_path(@user.username), class: ... %&amp;gt;&lt;/code&gt;). When I first implemented, I didn't pass any arguments to &lt;code&gt;user_path&lt;/code&gt; and it seemed to work ok. What are the issues/risks of doing so?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>performance</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Questions on Week1 HW</title>
      <dc:creator>shaan-erickson</dc:creator>
      <pubDate>Sun, 08 Jan 2023 23:38:26 +0000</pubDate>
      <link>https://dev.to/shaanerickson/questions-on-week1-hw-3h0a</link>
      <guid>https://dev.to/shaanerickson/questions-on-week1-hw-3h0a</guid>
      <description>&lt;ol&gt;
&lt;li&gt;When trying to simplify our routes, I received an error when creating a new movie. In the controller, we show the "movies/new" template if the movie does not satisfy the requirements (i.e. that there is a title/description). However, when I use &lt;code&gt;render template: "new"&lt;/code&gt;, I am met with errors when a movie without a title is submitted. If I replace it with &lt;code&gt;render template: "movies/new"&lt;/code&gt;, or if I say &lt;code&gt;render "new"&lt;/code&gt;there is no error. Why is the "movies" not implied in the case where I render a template?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Answer: &lt;code&gt;render template:&lt;/code&gt; requires the full path (i.e. &lt;code&gt;movies/new&lt;/code&gt;) whereas &lt;code&gt;render&lt;/code&gt; is a shortcut that uses the directory corresponding to the controller&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;We learned to replace anchor links with link_to elements. One of our links is an option to delete the movie, and part of the element is &lt;code&gt;data-method="delete"&lt;/code&gt;. How do we include that in the syntax for the link_to replacement?&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Answer: &lt;code&gt;&amp;lt;%= link_to "Delete movie", movie_path(@movie), method: :delete %&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>gratitude</category>
      <category>discuss</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
