<?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: Robert Sfarzo</title>
    <description>The latest articles on DEV Community by Robert Sfarzo (@rsfarzo).</description>
    <link>https://dev.to/rsfarzo</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%2F1106690%2F61ac59c8-2c80-4c21-8892-6ed1243b0b0c.JPG</url>
      <title>DEV Community: Robert Sfarzo</title>
      <link>https://dev.to/rsfarzo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rsfarzo"/>
    <language>en</language>
    <item>
      <title>Devise: custom fields</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Fri, 03 Nov 2023 17:32:08 +0000</pubDate>
      <link>https://dev.to/rsfarzo/devise-custom-fields-3jg3</link>
      <guid>https://dev.to/rsfarzo/devise-custom-fields-3jg3</guid>
      <description>&lt;p&gt;Great reference: &lt;a href="https://gist.github.com/withoutwax/46a05861aa4750384df971b641170407"&gt;https://gist.github.com/withoutwax/46a05861aa4750384df971b641170407&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Rails debugging</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Fri, 29 Sep 2023 14:51:01 +0000</pubDate>
      <link>https://dev.to/rsfarzo/rails-debugging-395c</link>
      <guid>https://dev.to/rsfarzo/rails-debugging-395c</guid>
      <description>&lt;p&gt;&lt;em&gt;Fear Ye Not the Red Screen of Better Errors&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--06IYhFfC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j40uv4e3wtn9hy5bia4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--06IYhFfC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j40uv4e3wtn9hy5bia4z.png" alt="Image description" width="800" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Missing template N&lt;/code&gt;
-- note controller#action render view's name, and check &lt;code&gt;views&lt;/code&gt; for misspelled folder/file names, or missing view&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;No route matches&lt;/code&gt;
-- compare &lt;code&gt;routes.rb&lt;/code&gt; name to controller route name
-- check form route exists in &lt;code&gt;routes.rb&lt;/code&gt;
-- check form route name&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;param is missing or the value is empty: PARAM_NAME&lt;/code&gt;
-- match the view form element's &lt;code&gt;name&lt;/code&gt; to the controller &lt;code&gt;fetch.params&lt;/code&gt; name&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;undefined local variable or method NAME&lt;/code&gt;
-- could be a local view var or method that is missing, but usually missed the &lt;code&gt;@&lt;/code&gt; for an instance variable that is defined in the controller#action&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uninitialized constant SOMEController&lt;/code&gt;
-- mispelled/non-matching controller name in &lt;code&gt;routes.rb&lt;/code&gt; and the actual filename &lt;code&gt;controllers\NAME_controller.rb&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;class/module name must be CONSTANT for controller&lt;/code&gt;
-- probably not CamelCase controller name in controller file&lt;/li&gt;
&lt;li&gt;always check logic, from math calcs to conditionals&lt;/li&gt;
&lt;li&gt;if a view does not display a value, probably missing the &lt;code&gt;=&lt;/code&gt; in &lt;code&gt;&amp;lt;%= %&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;be sure form text, elements, attributes match perfectly to spec, read more each test failure message and/or the actual test file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;label&lt;/code&gt; &amp;amp;&amp;amp; &lt;code&gt;/ROUTE displays NAME entered when the form is submitted&lt;/code&gt; errors: match html labels &lt;code&gt;for&lt;/code&gt; with the corresponding element &lt;code&gt;id&lt;/code&gt;, *these errors cascade to numerous other errors, disappointing at first but a giant relief when corrected&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>GitHub: clone, fork, template</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Thu, 14 Sep 2023 14:35:55 +0000</pubDate>
      <link>https://dev.to/rsfarzo/github-clone-fork-template-8kb</link>
      <guid>https://dev.to/rsfarzo/github-clone-fork-template-8kb</guid>
      <description>&lt;p&gt;The following is from &lt;a href="https://chat.openai.com/"&gt;ChaptGPT 3.5&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;GitHub provides several ways to work with repositories, including fork, clone, and templates. Here's an explanation of the differences between these actions:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fork&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage&lt;/strong&gt;: Forking is typically used when you want to contribute to someone else's repository on GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ownership&lt;/strong&gt;: When you fork a repository, it creates a copy of the original repository under your GitHub account. You don't have write access to the original repository; instead, you have your copy, which you can modify.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relationship&lt;/strong&gt;: There is a link between the original repository and your fork, which allows you to sync changes from the original repository into your fork.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration&lt;/strong&gt;: You can make changes to your fork, commit them, and then create a pull request to propose changes to the original repository. The owner of the original repository can then review and merge your changes if they want.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Clone&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage&lt;/strong&gt;: Cloning is used when you want to work with a repository locally on your computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ownership&lt;/strong&gt;: When you clone a repository, it creates a copy of the repository on your local machine. You can make changes to the repository on your computer, and these changes do not affect the original repository on GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration&lt;/strong&gt;: Cloning is typically used for personal work, and you can push your changes back to the repository on GitHub if you have the necessary permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Template&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage&lt;/strong&gt;: A repository template is a special type of repository that serves as a starting point for new repositories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ownership&lt;/strong&gt;: When you create a repository from a template, it doesn't create a direct copy of the template. Instead, it sets up a new repository with the same directory structure and files as the template.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration&lt;/strong&gt;: Templates are typically used to create consistent project structures, and the new repositories created from templates are independent. You can collaborate on the new repository as you would with any other repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Forking&lt;/strong&gt; is used for contributing to others' repositories and maintaining a connection to the original repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloning&lt;/strong&gt; is used for working with a repository locally on your computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Templates&lt;/strong&gt; are used to create new repositories with a predefined structure and content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these actions serves a different purpose, and the choice depends on your specific needs and workflow.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Read the instructions</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Thu, 14 Sep 2023 14:12:58 +0000</pubDate>
      <link>https://dev.to/rsfarzo/read-the-instructions-32am</link>
      <guid>https://dev.to/rsfarzo/read-the-instructions-32am</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Today I learned to read the instructions.&lt;/li&gt;
&lt;li&gt;Today I learned that I will not always read the instructions.&lt;/li&gt;
&lt;li&gt;Today I learned that ideally I read the instructions.&lt;/li&gt;
&lt;li&gt;Today I learned that sometimes I do not need to read the instructions&lt;/li&gt;
&lt;li&gt;Today I learned to take risks, and own the consequences.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>documentation</category>
    </item>
    <item>
      <title>Create &amp; Review Pull Requests in VSCode</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Thu, 17 Aug 2023 19:10:55 +0000</pubDate>
      <link>https://dev.to/rsfarzo/create-review-pull-requests-in-vscode-1fm4</link>
      <guid>https://dev.to/rsfarzo/create-review-pull-requests-in-vscode-1fm4</guid>
      <description>&lt;p&gt;Sharing some bookmarks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://youtu.be/Ma67EbIHi64"&gt;Create a Pull Request from Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/DSl-L6B_Qb4"&gt;Review a Pull Request from Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Rails Active Storage</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Tue, 15 Aug 2023 16:17:56 +0000</pubDate>
      <link>https://dev.to/rsfarzo/rails-active-storage-315b</link>
      <guid>https://dev.to/rsfarzo/rails-active-storage-315b</guid>
      <description>&lt;p&gt;&lt;strong&gt;App feature&lt;/strong&gt; &lt;br&gt;
You want your users to upload and store large objects like media and document files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge&lt;/strong&gt;&lt;br&gt;
Many of our Rails deployments have, and should have, persistent storage for the server application code. While we can have public folders, we really do not want to store large files there. Why?  It doesn't scale. When we scale up our server to accommodate surges in requests, we would waste a lot of time and space copying over a huge public folder. And, syncing would be a challenge for create, update, and delete operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recall&lt;/strong&gt; &lt;br&gt;
To save information in relational databases, we tie our Active Records to database systems like PostgreSQL. Databases are designed to be well-synchronized.  But, we don't put huge data objects in the database, and usually we store a link to some persistent storage locations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Active Storage&lt;/strong&gt;&lt;br&gt;
I stumbled into this topic today when saw a cool post about how to utilize &lt;a href="https://code.avi.nyc/an-activestorage-s3-direct-uploader-part-1-the-drag-and-drop-interface"&gt;Active Storage for AWS S3&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;And that led me to &lt;a href="https://guides.rubyonrails.org/active_storage_overview.html"&gt;Active Storage&lt;/a&gt;  in general for attaching cloud files (Google, Azure, AWS, etc.) to our Active Records.  Cool! &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ruby Class Syntax</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Tue, 08 Aug 2023 17:43:37 +0000</pubDate>
      <link>https://dev.to/rsfarzo/ruby-class-syntax-4e4h</link>
      <guid>https://dev.to/rsfarzo/ruby-class-syntax-4e4h</guid>
      <description>&lt;p&gt;Ruby's class and object syntax is beautiful. Python's can get gangly for large projects, and Java's is excessively verbose.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>cleancode</category>
      <category>python</category>
      <category>java</category>
    </item>
    <item>
      <title>MCV Frameworks</title>
      <dc:creator>Robert Sfarzo</dc:creator>
      <pubDate>Thu, 22 Jun 2023 23:16:04 +0000</pubDate>
      <link>https://dev.to/rsfarzo/hi-3ik4</link>
      <guid>https://dev.to/rsfarzo/hi-3ik4</guid>
      <description>&lt;p&gt;By chance and by deliberately researching, I have discovered that there are many other web stack frameworks that implement the Model-View-Controller paradigm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For example, looking at popular data science framework Django, I thought: 'wow, this is Ruby on Rails but in Python.'  Personally, I like Ruby much more than Python, but it lacks the data science libraries.
&lt;/li&gt;
&lt;li&gt;Another example is Laravel.  This MVC framework was created to improve PHP stacks. A very, very old piece of the old LAMP stack, PHP is used by a vast majority of web sites.  I've worked with PHP: ugh, super recursive and time-consuming to debug. It's sort of like an entrenched cancer.&lt;/li&gt;
&lt;li&gt;and there are several more MVC frameworks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, learning Ruby on Rails has been a fun and relevant adventure.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
