<?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: Evelyn Hernandez</title>
    <description>The latest articles on DEV Community by Evelyn Hernandez (@devev).</description>
    <link>https://dev.to/devev</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F610828%2F1d37e175-0cfb-4d87-9fa8-df453b8f7442.jpg</url>
      <title>DEV Community: Evelyn Hernandez</title>
      <link>https://dev.to/devev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devev"/>
    <language>en</language>
    <item>
      <title>Request/Response Cycle</title>
      <dc:creator>Evelyn Hernandez</dc:creator>
      <pubDate>Sat, 23 Apr 2022 18:57:06 +0000</pubDate>
      <link>https://dev.to/devev/requestresponse-cycle-2lmm</link>
      <guid>https://dev.to/devev/requestresponse-cycle-2lmm</guid>
      <description>&lt;p&gt;A common category of web applications built with RoR are form-based apps, which give users a form for submitting data, which stores that data in a database and lets users view or modify those entries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Displaying the form to the user&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user enters a &lt;em&gt;URL path&lt;/em&gt; on their browser and executes.&lt;/li&gt;
&lt;li&gt;When the URL path is executed, the browser sends a &lt;em&gt;GET&lt;/em&gt; request for that URL.&lt;/li&gt;
&lt;li&gt;The GET request hits the &lt;em&gt;rails router&lt;/em&gt; (config/routes.rb). The router maps the URL to a &lt;em&gt;controller action&lt;/em&gt; to handle the request.&lt;/li&gt;
&lt;li&gt;The controller action receives the GET request and passes it on to the &lt;em&gt;view&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The view &lt;em&gt;renders the page as HTML&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The controller sends the HTML back to the browser. The page loads and the user sees the page with the form.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Submitting the form&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user fills and &lt;em&gt;submits&lt;/em&gt; the form.&lt;/li&gt;
&lt;li&gt;When the form is submitted, the browser sends a &lt;em&gt;POST&lt;/em&gt; request to the Rails app.&lt;/li&gt;
&lt;li&gt;The POST request hits the &lt;em&gt;rails router&lt;/em&gt;(config/routes.rb). The router maps the POST request to the correct controller action.&lt;/li&gt;
&lt;li&gt;The &lt;em&gt;controller action&lt;/em&gt; receives the POST request. The controller action retrieves the submitted data from the form and uses the model to store the data into the database.&lt;/li&gt;
&lt;li&gt;The &lt;em&gt;model&lt;/em&gt; completes its task.&lt;/li&gt;
&lt;li&gt;The &lt;em&gt;controller action&lt;/em&gt; passes the request on to the &lt;em&gt;view&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The view &lt;em&gt;renders the page as HTML&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The controller sends the HTML back to the browser. The page loads and the user sees it.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>beginners</category>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Rails Standard Controller Actions</title>
      <dc:creator>Evelyn Hernandez</dc:creator>
      <pubDate>Sat, 23 Apr 2022 18:33:07 +0000</pubDate>
      <link>https://dev.to/devev/rails-standard-controller-actions-52o9</link>
      <guid>https://dev.to/devev/rails-standard-controller-actions-52o9</guid>
      <description>&lt;p&gt;Controller &lt;em&gt;actions&lt;/em&gt;: Are the methods created inside the controller file, which are used for displaying and modifying data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t4keA8l_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8gxmp5yglo8rgywrjnq.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t4keA8l_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8gxmp5yglo8rgywrjnq.jpeg" alt="Image description" width="880" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTTP Verb&lt;/strong&gt; exists in your &lt;strong&gt;&lt;em&gt;config/routes.rb&lt;/em&gt;&lt;/strong&gt; file. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Path&lt;/strong&gt; refers to the URL a user inputs in their browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controller#action&lt;/strong&gt; refers to the actions in the &lt;strong&gt;&lt;em&gt;app/controllers/messages_controller.rb&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to create routes for all 7 actions in your app, you can add a resource route to your &lt;em&gt;routes.rb&lt;/em&gt; file. The resource route maps URLs to the Messages controller's 7 actions which are (index, show, new, create, edit, update and destroy)&lt;br&gt;
&lt;code&gt;resources :messages&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you only want to create routes for specific actions, use :only. The code line below maps URLs only to the Messages controller's index and show actions.&lt;br&gt;
&lt;code&gt;resources :messages, only: [:index, :show]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here is a link on more information about &lt;a href="(https://guides.rubyonrails.org/routing.html)"&gt;Rails Routing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
