<?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: Sheridan</title>
    <description>The latest articles on DEV Community by Sheridan (@sheridan95).</description>
    <link>https://dev.to/sheridan95</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%2F620332%2F49cda252-58d5-4dd9-b18d-cd5d38199859.png</url>
      <title>DEV Community: Sheridan</title>
      <link>https://dev.to/sheridan95</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sheridan95"/>
    <language>en</language>
    <item>
      <title>How to Deploy your app to Heroku</title>
      <dc:creator>Sheridan</dc:creator>
      <pubDate>Tue, 12 Jul 2022 18:11:15 +0000</pubDate>
      <link>https://dev.to/sheridan95/how-to-deploy-your-app-to-heroku-4k9b</link>
      <guid>https://dev.to/sheridan95/how-to-deploy-your-app-to-heroku-4k9b</guid>
      <description>&lt;p&gt;Hello, this blog is going to explain how to deploy an app that was made with a ruby on rails backend and a react frontend.&lt;/p&gt;

&lt;p&gt;To begin you want to create a heroku account, this is free and necessary to use the site to deploy your app. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KMT32TY8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m3loc3nnl8p85cthiy8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KMT32TY8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m3loc3nnl8p85cthiy8k.png" alt="Image description" width="880" height="939"&gt;&lt;/a&gt;&lt;br&gt;
Once you have created the account go to your project and sign in to heroku through the terminal.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VTlmQ0Hg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zycgel6v8j154ckz06cy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VTlmQ0Hg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zycgel6v8j154ckz06cy.png" alt="Image description" width="585" height="40"&gt;&lt;/a&gt;&lt;br&gt;
It will direct you to the heroku site to log you in. &lt;/p&gt;

&lt;p&gt;Disclaimer- before you do anything inside of heroku make sure that you have pushed all your data to github using these commands.&lt;br&gt;
&lt;code&gt;git add .&lt;/code&gt; &lt;code&gt;git commit -m "message"&lt;/code&gt; and &lt;code&gt;git push&lt;/code&gt;&lt;br&gt;
This is what heroku will use to build the app on their site to eventually deploy it.&lt;/p&gt;

&lt;p&gt;Ok, now that all your information is updated and you are logged into heroku you want to make sure that heroku is available on your application by running these commands&lt;br&gt;
&lt;code&gt;heroku buildpacks:add heroku/nodejs --index 1&lt;/code&gt;&lt;br&gt;
&lt;code&gt;heroku buildpacks:add heroku/ruby --index 2&lt;/code&gt;&lt;br&gt;
If they are installed already it will give an error that looks like this &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pk1lp-kp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x3spcgnv66ebn2euvcni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pk1lp-kp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x3spcgnv66ebn2euvcni.png" alt="Image description" width="880" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright! Almost there!&lt;/p&gt;

&lt;p&gt;Next we want to make sure that heroku sees the app that we are building. To push the information to heroku type: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k7zO2yXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2o3eqxdjixydn3iaae7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k7zO2yXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2o3eqxdjixydn3iaae7x.png" alt="Image description" width="274" height="30"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, if everything was set up correctly this command will initiate a long line of code that will take a couple minutes to complete. If everything looks good it should also migrate the information for you. If there is an issue and it says &lt;code&gt;rails aborted&lt;/code&gt; you can view the error and fix it accordingly. For more information about what the error is you can use the command:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7sVB2GT1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54puap626dd7uu4ltxxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7sVB2GT1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54puap626dd7uu4ltxxd.png" alt="Image description" width="244" height="32"&gt;&lt;/a&gt;&lt;br&gt;
It should populate where exactly the application failed. &lt;/p&gt;

&lt;p&gt;Side note: if you are using image uploading make sure you are using a public site to upload them to. Meaning somewhere not on your local hard drive. A place where heroku can see. I used AWS and used a bucket to upload my images. I also changed my seeds file in my database to tell the application where to view the images. You also need to include them under the "Config Vars" &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NpyQxHPC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dfc2ssdfqcsuw303pyfi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NpyQxHPC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dfc2ssdfqcsuw303pyfi.png" alt="Image description" width="880" height="252"&gt;&lt;/a&gt;&lt;br&gt;
Just click reveal confiv vars and put the keys into the key and value areas so heroku knows where to look. &lt;/p&gt;

&lt;p&gt;Side side note. Make sure your public keys are in an .env file so that they are available but hidden to the public eye. Learn from my mistakes.&lt;/p&gt;

&lt;p&gt;Back to our regularly scheduled program. &lt;/p&gt;

&lt;p&gt;Ok, so you should have been able to push and migrate your data. Now we can seed our data. Go ahead and type: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PUbr9oiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgh74rn71496iqw23x9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PUbr9oiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgh74rn71496iqw23x9w.png" alt="Image description" width="327" height="31"&gt;&lt;/a&gt;&lt;br&gt;
This command may also take a little bit of time. If there is an error there make sure that you type: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7sVB2GT1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54puap626dd7uu4ltxxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7sVB2GT1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54puap626dd7uu4ltxxd.png" alt="Image description" width="244" height="32"&gt;&lt;/a&gt;&lt;br&gt;
to see exactly where the application failed. Be warned, this might be time consuming but you are so close! &lt;/p&gt;

&lt;p&gt;If you did run into an error while pushing or seeding your data to heroku you might want to restart your database so heroku has the most up to date information. Use this command &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QlTRD-_d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g223lllydyps607xv1ij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QlTRD-_d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g223lllydyps607xv1ij.png" alt="Image description" width="859" height="34"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To find the name of your project it will be here&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AZSJvv1i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8358om5dtvm66nlgtr9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AZSJvv1i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8358om5dtvm66nlgtr9q.png" alt="Image description" width="880" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't push it the updated version to heroku just yet. You want to make a slight change to your application so github sees a change. Something as simple as this will do it.&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0c9JrxC0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xz7hu0gqdsxm7y8ph05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0c9JrxC0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xz7hu0gqdsxm7y8ph05.png" alt="Image description" width="268" height="54"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So close, stay with me. &lt;/p&gt;

&lt;p&gt;Now that you have restarted your heroku database and made the proper changed to your project, you can go ahead and re-push the information to heroku. If you forgot the command, here it is:&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k7zO2yXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2o3eqxdjixydn3iaae7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k7zO2yXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2o3eqxdjixydn3iaae7x.png" alt="Image description" width="274" height="30"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once again, this should automatically migrate your information to heroku. You can them type in: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PUbr9oiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgh74rn71496iqw23x9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PUbr9oiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgh74rn71496iqw23x9w.png" alt="Image description" width="327" height="31"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When heroku is done seeding it should say something like the "seeding is complete" and will give you a URL. Click that URL and BAM your project is deployed through heroku! &lt;/p&gt;

&lt;p&gt;Congrats you did it!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>react</category>
      <category>rails</category>
    </item>
    <item>
      <title>Implementing Image Uploading in Ruby</title>
      <dc:creator>Sheridan</dc:creator>
      <pubDate>Tue, 05 Jul 2022 13:56:22 +0000</pubDate>
      <link>https://dev.to/sheridan95/using-to-implement-image-uploading-in-ruby-4862</link>
      <guid>https://dev.to/sheridan95/using-to-implement-image-uploading-in-ruby-4862</guid>
      <description>&lt;p&gt;Hello, this blog is simply going to walk you through how to implement image uploading to a react frontend with a ruby on rails backend.&lt;/p&gt;

&lt;p&gt;First you want to create your database. Making sure you have models, controllers, and serializers for your data. You will also want to make sure that you have told your seeds file that your database contains images. Here is an example.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EkxzSsOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebtvenvqmose4ku1cplc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EkxzSsOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebtvenvqmose4ku1cplc.png" alt="Image description" width="880" height="431"&gt;&lt;/a&gt; You can see I implemented the images on lines 15, 17, 19, 23, 25, and 27. I was able to save my images in a file and access them through &lt;code&gt;app/assests/imagefilename&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once you have that you want to install active storage using the command: &lt;br&gt;
&lt;code&gt;rails active_storage:install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After that run the migration using: &lt;br&gt;
&lt;code&gt;rails db:migrate&lt;/code&gt;&lt;br&gt;
This will create two new tables called &lt;code&gt;active_storage_blobs&lt;/code&gt; and &lt;code&gt;active_storage_attachments&lt;/code&gt;. These are important. Your code should also automatically include the files &lt;code&gt;storage&lt;/code&gt; this will be where the database stores the images you added, as well as any more you add along the way. &lt;/p&gt;

&lt;p&gt;These commands should also add a &lt;code&gt;storage.yml&lt;/code&gt; file. If none of these files are included simply add them in and it should work.&lt;/p&gt;

&lt;p&gt;Now that all the files have been created and your images are in your database, it is time to create your associations. If for example you created image uploading in products your &lt;code&gt;product.rb&lt;/code&gt; file should include an association saying &lt;code&gt;has_one_attached&lt;/code&gt; and what you called the image. For example: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OqLSVhUT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h8swenl7fvwzg69xbw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OqLSVhUT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h8swenl7fvwzg69xbw8.png" alt="Image description" width="880" height="432"&gt;&lt;/a&gt;On line 8 I called my images for the products &lt;code&gt;:photo&lt;/code&gt;. The &lt;code&gt;dependent: :destroy&lt;/code&gt; is basically saying if I delete a product remove the attached image as well. &lt;/p&gt;

&lt;p&gt;Whew, almost done with the backend section. Ok, now that we have that, next we need to make sure we have the proper validations to not throw an error. There are a couple ways to do this. You could write the validation in the model like so : &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VcCsr8hi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70sa91ozhja6qyphqxpo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VcCsr8hi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70sa91ozhja6qyphqxpo.png" alt="Image description" width="464" height="83"&gt;&lt;/a&gt; with a helper method such as this: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jvts6TC1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4wqcwwkiyga6otnrdiz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jvts6TC1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4wqcwwkiyga6otnrdiz.png" alt="Image description" width="648" height="159"&gt;&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I chose to do mine this way, implementing a helper method in my serializer. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W5CagWcU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkse846ce6iz81gcbeke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W5CagWcU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkse846ce6iz81gcbeke.png" alt="Image description" width="880" height="66"&gt;&lt;/a&gt;&lt;br&gt;
If you are able to I recommend doing it the first way I mentioned. &lt;/p&gt;

&lt;p&gt;To make sure the image is the proper size you can add logic to your helper method such as &lt;br&gt;
&lt;code&gt;unless main_image.byte_size &amp;lt;= 1.megabyte&lt;br&gt;
    errors.add(:main_image, "is too big")&lt;br&gt;
  end&lt;/code&gt;&lt;br&gt;
as well as &lt;br&gt;
&lt;code&gt;acceptable_types = ["image/jpeg", "image/png"]&lt;br&gt;
  unless acceptable_types.include?(main_image.content_type)&lt;br&gt;
    errors.add(:main_image, "must be a JPEG or PNG")&lt;br&gt;
  end&lt;/code&gt;&lt;br&gt;
These would be to make sure your image is in the correct format and that it is a decent size to be able to display it in your front end.&lt;/p&gt;

&lt;p&gt;Ok, hang in there. Almost done! &lt;/p&gt;

&lt;p&gt;Next, we need to make sure we have access to the images. We can do that be installing a gem in the Gemfile called: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RsjfiSBD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vm005w8o9un03xubwgnj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RsjfiSBD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vm005w8o9un03xubwgnj.png" alt="Image description" width="472" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then install it using &lt;code&gt;bundle install&lt;/code&gt; in the terminal. You also want to say &lt;code&gt;sudo apt-get install imagemagick&lt;/code&gt; to make sure you have all the logic implement. &lt;/p&gt;

&lt;p&gt;Now that the logic is in all you need to do is let your frontend know there is an image to be used. This is the example that I used. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QgXuovWy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsct24pvuqp94wef22pn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QgXuovWy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsct24pvuqp94wef22pn.png" alt="Image description" width="880" height="28"&gt;&lt;/a&gt;&lt;br&gt;
This calls avatarURl and assigns it to the image that I use on line 26.&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2Giaa2_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmq5fdcwrni2xzt3kf2h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2Giaa2_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmq5fdcwrni2xzt3kf2h.png" alt="Image description" width="693" height="56"&gt;&lt;/a&gt;&lt;br&gt;
  It's a ternary to say if the image I uploaded is present display it, otherwise show the default avatar that I uploaded.&lt;/p&gt;

&lt;p&gt;Boom! Just like that you have implemented image uploading!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>database</category>
      <category>rails</category>
    </item>
    <item>
      <title>Creating an Application| Ruby on Rails</title>
      <dc:creator>Sheridan</dc:creator>
      <pubDate>Tue, 31 May 2022 19:41:22 +0000</pubDate>
      <link>https://dev.to/sheridan95/creating-a-database-ruby-on-rails-1lp5</link>
      <guid>https://dev.to/sheridan95/creating-a-database-ruby-on-rails-1lp5</guid>
      <description>&lt;p&gt;Hello again! This blog is all about the basics of starting a Ruby on Rails backend to communicate to a React frontend. For our purposes we will build a todo list. The most basics portions of a Rails app is the route, controllers, model, and of course using all of that to migrate the data. Let's get started!&lt;/p&gt;

&lt;p&gt;To begin, you want to create your Rails app. Simply open a terminal and cd into the directory where you want to create the rails app. Type in the following code and viola, a new app is created. &lt;br&gt;
&lt;code&gt;rails new name of your app&lt;/code&gt;&lt;br&gt;
It should look something like this: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1pFmjZMH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wihpdsvr8eup9eg3qsx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1pFmjZMH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wihpdsvr8eup9eg3qsx.png" alt="Image description" width="778" height="35"&gt;&lt;/a&gt;My app being called example app. Once you have created the app cd into it and we can start building the basics.&lt;br&gt;
&lt;code&gt;cd example-app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Ok, now that it's created it we want to take a look around.&lt;/p&gt;

&lt;p&gt;Let's start by adding a route to our routes file, config/routes.rb.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S1w3pj2Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqn4bh3yemtr3lkxzl20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S1w3pj2Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqn4bh3yemtr3lkxzl20.png" alt="Image description" width="465" height="110"&gt;&lt;/a&gt; This is what mine would look like. This code would display all the todos that I have.&lt;/p&gt;

&lt;p&gt;Next we want to create a controller &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_GqJ_BGf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7pb0x51ifupveeudhx6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_GqJ_BGf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7pb0x51ifupveeudhx6g.png" alt="Image description" width="745" height="40"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8MWuLjeI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6bvrjw3wvn5e0dih72d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8MWuLjeI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6bvrjw3wvn5e0dih72d.png" alt="Image description" width="626" height="206"&gt;&lt;/a&gt;I went ahead and put this code in for the most basic functionality.&lt;/p&gt;

&lt;p&gt;Now that we have a controller and a route let's create the next piece, the model.&lt;/p&gt;

&lt;p&gt;A model is what Ruby uses to represent data. To create a model, let's use the model generator&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KIeq73T9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s96w1f77c4ttt52rf3bt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KIeq73T9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s96w1f77c4ttt52rf3bt.png" alt="Image description" width="703" height="29"&gt;&lt;/a&gt;This will create the most basic structure for the todo table - a title in the form of a string, and a body in the form of text.&lt;/p&gt;

&lt;p&gt;This will create a models/todo.rb file. In there I wrote some basic code to get the app working.&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y67PGkip--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1cto2zxfqrl0pq41fjya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y67PGkip--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1cto2zxfqrl0pq41fjya.png" alt="Image description" width="477" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whew, we are almost there! &lt;/p&gt;

&lt;p&gt;The last thing needed to create the most basic application is to migrate &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pEyfSGD8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tekkc3ov4h8cgre32xe2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pEyfSGD8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tekkc3ov4h8cgre32xe2.png" alt="Image description" width="880" height="137"&gt;&lt;/a&gt;Simply run &lt;code&gt;rails db:migrate&lt;/code&gt; in the terminal. The four lines below are to show that the migration is successful.&lt;/p&gt;

&lt;p&gt;To make sure that your application was created successfully you can run &lt;code&gt;rails s&lt;/code&gt; A.K.A. &lt;code&gt;rails server&lt;/code&gt; the browser should return something like this&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Aa0ZQcHN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6p5g4bixav5u2iixj3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Aa0ZQcHN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6p5g4bixav5u2iixj3t.png" alt="Image description" width="486" height="260"&gt;&lt;/a&gt; The array is empty because we created an application but did not put any information into the database yet. &lt;/p&gt;

&lt;p&gt;Congratulations! You have officially created a basic Ruby on Rails App!&lt;/p&gt;

</description>
      <category>rails</category>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What is Postman?!</title>
      <dc:creator>Sheridan</dc:creator>
      <pubDate>Mon, 28 Mar 2022 15:36:05 +0000</pubDate>
      <link>https://dev.to/sheridan95/what-is-postman-iab</link>
      <guid>https://dev.to/sheridan95/what-is-postman-iab</guid>
      <description>&lt;p&gt;Hello beautiful people! It's me again coming to tell you about Postman. So first, what is postman? Well, Postman is an application where an user can send requests to a JSON server (a Node package that turns a JSON file on your computer into data storage) and find out if the request works or not.&lt;/p&gt;

&lt;p&gt;For example, let's say you are building a project using Ruby and JavaScript. Ruby being backend and JavaScript being frontend of course. You are going to want to send data that you create in the backend, to the frontend. You know, so that you can see what is happening on your web application. Postman is a fantastic way to do that!&lt;/p&gt;

&lt;p&gt;Let's say in our backend we create a todo list that has multiple users. You may want to perform a few CRUD (Create Read Update, Delete) operations. To start you want to download postman from their website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.postman.com/downloads/"&gt;https://www.postman.com/downloads/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure you set it up properly. Just so you know, you don't have to sign in, you are able to say 'skip and go to the app'. Then you just click 'Get Started', 'Create a request'. After that you figure out which CRUD operation you want to use, make sure the URL that you are typing matches with the one you created in the backend, and voila you have successfully used postman!&lt;/p&gt;

&lt;p&gt;Now you are able to 'get', 'patch', 'post', 'delete', etc., through postman. Go crazy, really play around with it until you fully understand what it does. I will also recommend you pay close attention to what you type in the 'Body' portion. You want to make sure that the object you type has the exact parameters you laid out in the backend. Otherwise you are really going to confuse yourself. &lt;/p&gt;

&lt;p&gt;I hope this helps, remember, don't be afraid to try multiple requests, after all this is your project and you want to make sure you know everything inside and out.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>frontend</category>
      <category>bac</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React- how to begin</title>
      <dc:creator>Sheridan</dc:creator>
      <pubDate>Sun, 08 Aug 2021 01:29:24 +0000</pubDate>
      <link>https://dev.to/sheridan95/react-how-to-begin-33c</link>
      <guid>https://dev.to/sheridan95/react-how-to-begin-33c</guid>
      <description>&lt;p&gt;Hello everyone, welcome back to my blog! Or, if you haven't been here before, welcome! This blog is all about react. I'll be showing you the basics of how to begin an application through react. So hang on tight, it's gonna be a bumpy ride. Just kidding, the start up is actually pretty simple to understand!&lt;/p&gt;

&lt;p&gt;First off, we need to create the react app in the first place. This is done by going to a handy dandy place called the terminal. Mine is called "Ubuntu" but there are many to choose from. If you are working with ubuntu you are going to navigate to where you want your project to be located. For example, I want mine under "sheridan-codes" so I am going to type "cd sheridan-codes" it should look something like this :&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UsCV6H-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2osnx5zacht5y78cn2k8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UsCV6H-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2osnx5zacht5y78cn2k8.png" alt="Terminal Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we are in the location we want, we can create our actual project. How exciting! Once in the location, type in "npx create-react-app (what my app is named)" this basically means create a react app that is called something. Let's say for example we want it to be called "practice-app". We would then write npx create-react-app practice-app. Easy enough right? See you're halfway there! This step will look something like this: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gUX7i0mp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d8zgrw939ciuto6hs9j0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gUX7i0mp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d8zgrw939ciuto6hs9j0.png" alt="Terminal Example Two"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now just a heads up, this step will take a minute to work it's magic, don't be alarmed if it takes a minute or two to say it's done. Once it's completed the installation of the files you can run the usual "code ." to open your project.&lt;/p&gt;

&lt;p&gt;Congratulations, you have officially created a project in react! Now you're ready to begin creating components and designing an awesome application. To start kicking butt and taking names. To show Tom, who thinks he is hot stuff and likes to show off, who is boss!&lt;/p&gt;

&lt;p&gt;One final disclaimer I feel I need to mention before I leave you. If this is your first project do not, I repeat, do not change or alter the HTML file! Trust me, I have made that mistake before and I had to begin the whole project over again, which was not fun. This is the file you should stay away from:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9FLtZxP3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oijl9j33hxds2cmwjmos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9FLtZxP3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oijl9j33hxds2cmwjmos.png" alt="HTML File"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this information was helpful to you, thank you so much for reading and allowing me to lead you on this journey. Good luck coders, you got this!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>My first official project</title>
      <dc:creator>Sheridan</dc:creator>
      <pubDate>Fri, 28 May 2021 21:19:57 +0000</pubDate>
      <link>https://dev.to/sheridan95/my-first-official-project-2oc5</link>
      <guid>https://dev.to/sheridan95/my-first-official-project-2oc5</guid>
      <description>&lt;p&gt;Hello everyone! It's me again coming to talk about the first project I have done to date. Well technically the only project in this boot-camp I have done... so far. Let me just tell you how fun this was, and by fun I mean so much fun I wanted to pull my hair out the whole time. &lt;/p&gt;

&lt;p&gt;Just kidding.... kinda...&lt;/p&gt;

&lt;p&gt;Anyway, we were given a task to create a webpage that contains a HTML, JavaScript, and a CSS file. The parameters were to create three event listeners and use a public API. Oh, and the entire app had to run on a single web page meaning only one HTML page. Not that difficult right? Well you would be correct except when you are given this task on your own. As in the only piece you are given is a git repository to fork.&lt;/p&gt;

&lt;p&gt;So, step one, fork your code. Easy enough I think. Perfect, now the fun part. you have to create your HTML, CSS, and JS which is also easy enough with a simple google search. &lt;/p&gt;

&lt;p&gt;Ok, now for the real interesting part. figuring out what you want your website to look like and finding a public API to use. I will take a second to stress how important it is to plan out your website. What it looks like and what exactly you want it to do. You know, like the old saying measure twice cut once. I learned that particular lesson the hard way. Just, you know, do what I say not what I do.&lt;/p&gt;

&lt;p&gt;Anyway, I decided upon a GitHub API that projects random pictures of cats on the screen. Perfect. I essentially decided on creating a "click me" button that when pressed would pull up pictures of cats. Yes, you guessed it, this is where that event listener comes into play! Now if you're wondering where the event listener goes, well let me tell you. You first have to create a button tag in the HTML (because "click me" is in the form of a button), then you can link it in the JS.&lt;/p&gt;

&lt;p&gt;Voila you have an event listener. I know what you're thinking, Sheridan you said you have to have at least three to pass this project. Yes, you are correct, that's why I put in a comment section where you would be able to leave a comment about the cats. I also put in a heart button where you can, you guessed it, like the page. We are just cruising alone here, look at us go! I will go ahead and say I am making this sound like a walk in the park but trust me when I tell you, creating that heart button and trying to get it to work had me question my sanity multiple times. It was a shit show to be frank. I think I literally screamed in pure joy when it finally worked. Back to my process.&lt;/p&gt;

&lt;p&gt;Ok, so what do you think is next up? Well, you have already put buttons into your HTML for the "click me", the "submit", and the "heart button". We have added our event listeners to the JS. If you were thinking that we have to actually get our API working you would be correct. So in all honesty I would suggest ensuring the API works to begin with. It is fantastic to get your HTML set up in a way that you understand and makes the website pleasing to the eye, but, if your API does not work then you will end up having to start from scratch.&lt;/p&gt;

&lt;p&gt;Guess what I had to do...&lt;/p&gt;

&lt;p&gt;Yep, that's right. The API I had originally set out to use ended up now working properly so I had to scrap my idea and start from scratch. Fun. So, take my advice, make sure the URL for your API works. Once you ensure it does it is time to fetch it. Fetching an API can be done a few different ways. I chose to fetch mine in the JS and honestly it worked out swimmingly for me. Did I have to reach out to my instructor a little for this, maybe, but no shame in that game. I learned something from it and that is all that matters. &lt;/p&gt;

&lt;p&gt;The last thing I did was add finishing touches. Such as making sure all the buttons were centered and looking nice. I decided to put the "Click me" button in a black box that would separate it from the heart and submit button. At the end of the day it is all personal preference.&lt;/p&gt;

&lt;p&gt;If I had to do this project again I would absolutely give myself more time to think about the layout and specific spacing of things. I think I would also add some more fancy things like a like button for each individual photo in the API, but there was no way I was going to have time for that. I would also have put a column to the side where the most liked photos would be. But, again that would mean I would also have to set a like button to each picture. Not impossible, just way too time consuming and complicated for the level I am at currently. &lt;/p&gt;

&lt;p&gt;Anyway, I hope this blog was helpful and made you feel like you could conquer your own website/ app. See ya on the next one!&lt;/p&gt;

</description>
      <category>engineering</category>
    </item>
    <item>
      <title>Why Software Engineering?</title>
      <dc:creator>Sheridan</dc:creator>
      <pubDate>Mon, 26 Apr 2021 13:01:48 +0000</pubDate>
      <link>https://dev.to/sheridan95/why-software-engineering-1p51</link>
      <guid>https://dev.to/sheridan95/why-software-engineering-1p51</guid>
      <description>&lt;p&gt;Hey guys, Sheridan here! I wanted to hop on and talk about my journey in software engineering, why I'm here, what makes me want to do this, so on and so forth.&lt;/p&gt;

&lt;p&gt;First, let me start out with saying I am not someone who knows a lot about computers or computer programs. I am a total beginner when it comes to coding. Anything beyond the basics of control C and how to minimize and maximize a webpage is beyond my scope of understanding. But, I have friends who have gone through coding boot camps and talked about how much freedom it allows. I see how much fun they have with the people they work with, and how they just seem to be having a good time doing their job. they recommended the flatiron boot camp, now here we are.&lt;/p&gt;

&lt;p&gt;Anyway, all that to say I dabbled in HTML on my own time just to see what I thought... and holy crap was it fun! I was able to dabble in HTML, CSS, and Java script to create a basic website. &lt;/p&gt;

&lt;p&gt;I will go ahead and state that this is the hardest thing I have ever done by far. Total cluster ~you know what ~ when you're in the middle of coding. But, once you get it, it's similar to the feeling of hiking up a steep mountain and finally reaching the top and seeing those beautiful mountain views. &lt;/p&gt;

&lt;p&gt;I have an educational background. Meaning, I graduated with a bachelors degree in Anthropology and a minor in History. I know what you're thinking. Sheridan what the heck made you want to make a 360 and go to coding... on a computer... when all you were doing was scientific based nerd things. To be honest I don't even know. I want to eventually dabble in van life and I quickly realized the path I was on was not gonna be able to transfer on the road.&lt;/p&gt;

&lt;p&gt;I'm excited to continue this journey, and see what other doors are opened along the way!&lt;/p&gt;

</description>
      <category>bootcamp</category>
      <category>coding</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
