<?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: SinhueHerrera90</title>
    <description>The latest articles on DEV Community by SinhueHerrera90 (@sinhueherrera90).</description>
    <link>https://dev.to/sinhueherrera90</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%2F1038017%2F1ff3f307-10dd-4723-a217-05932d9983f7.jpeg</url>
      <title>DEV Community: SinhueHerrera90</title>
      <link>https://dev.to/sinhueherrera90</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sinhueherrera90"/>
    <language>en</language>
    <item>
      <title>Before September starts, I went back and remembered concat D;</title>
      <dc:creator>SinhueHerrera90</dc:creator>
      <pubDate>Thu, 31 Aug 2023 05:50:03 +0000</pubDate>
      <link>https://dev.to/sinhueherrera90/before-september-starts-i-went-back-and-remembered-concat-d-3bbl</link>
      <guid>https://dev.to/sinhueherrera90/before-september-starts-i-went-back-and-remembered-concat-d-3bbl</guid>
      <description>&lt;p&gt;So, the last couple of days I've been able to study for a bit, I finished my photogram-like exercise, I used bootstrap and now I feel more familiarized with it, I also learned how to jump to different branches when using git on the terminal, and overall I think I learned how to "simplify" my code, which I think is ultimately what I'd be doing as a professional developer&lt;/p&gt;

&lt;p&gt;ANYWAY, so I started taking back some of the basics on ruby (mainly classes) and I had completely forgotten about the concat method using ASCII Codes, I feel like, this would be an easy way to "impress" people who don't know anything about code haha, I'll try to do so with my sisters ☠️&lt;/p&gt;

&lt;p&gt;I also checked how to deploy applications using fly, I tried to deploy my first solo project, however I decided not to do so since I have to change my code and make it more DRY now that I've learned how to do so.&lt;/p&gt;

&lt;p&gt;I feel like every single time I learn something new in regards of coding, even if I go back to things I have already seen, I still feel like I've learned such an small amount of what being a developer is like while at the same time feeling like I've gotten a lot of information!&lt;/p&gt;

&lt;p&gt;Ok I would like to write in a more technical way but I think that will come with time, for now I want to kind of have this space to write about my experiences with coding, and once I get more comfortable I will try to start writing in a more technical way&lt;/p&gt;

&lt;p&gt;See yaaa!!&lt;/p&gt;

&lt;p&gt;xoxoxox&lt;/p&gt;

&lt;p&gt;Sinhue&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hola a todos, RIP Cheems</title>
      <dc:creator>SinhueHerrera90</dc:creator>
      <pubDate>Wed, 23 Aug 2023 06:26:51 +0000</pubDate>
      <link>https://dev.to/sinhueherrera90/hola-a-todos-rip-cheems-2l43</link>
      <guid>https://dev.to/sinhueherrera90/hola-a-todos-rip-cheems-2l43</guid>
      <description>&lt;p&gt;So, tonight I worked a bit more on my photogram industrial exercise, I am finally DONE with the data modeling and basically all the "backend" part of the project, now I am starting to add bootstrap onto it&lt;/p&gt;

&lt;p&gt;I'm doing partial view templates again just so I don't have to be writing LONG lines of code, and then writing their corresponding shared files, it's pretty much like just writing a template and then using that template link everywhere you want and/or need.&lt;/p&gt;

&lt;p&gt;I don't really have much tonight&lt;/p&gt;

&lt;p&gt;Oh and I also had to go back and forth on some of my models, because of the spelling errors I often have, at this point I will end up looking for a job that puts me to just read code cause I go back and forth OFTEN&lt;/p&gt;

&lt;p&gt;On another and last and most importantest note, a couple of days ago Cheems (the meme dog) passed away, so I'd like to ask you for a minute of silence, RIP Cheems, you will be missed &lt;/p&gt;

&lt;p&gt;xoxox&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5jKTwkGA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krc1hbuojdf6qt8dfgt1.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5jKTwkGA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krc1hbuojdf6qt8dfgt1.jpeg" alt="Chems in the skies with diamonds" width="350" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Always and forever&lt;/p&gt;

&lt;p&gt;Sinhue&lt;/p&gt;

</description>
      <category>cheems</category>
      <category>bootstrap</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Hello again, I am not taking so much time off this time</title>
      <dc:creator>SinhueHerrera90</dc:creator>
      <pubDate>Fri, 18 Aug 2023 06:51:13 +0000</pubDate>
      <link>https://dev.to/sinhueherrera90/hello-again-i-am-not-taking-so-much-time-off-this-time-3h3f</link>
      <guid>https://dev.to/sinhueherrera90/hello-again-i-am-not-taking-so-much-time-off-this-time-3h3f</guid>
      <description>&lt;p&gt;Hi darlings&lt;/p&gt;

&lt;p&gt;So, today I continued working on my photogram project, and although I didn't have much time to study, I learned a few valuable things that I think will make my work as a developer easier (given that they become easy at some point, of course)&lt;/p&gt;

&lt;p&gt;So today I saw new ways to encourage myself to code in a more DRY way: scopes and enums.&lt;/p&gt;

&lt;p&gt;Scopes are kind of a way to label specific things in my database so that I can retrieve them easier in the future&lt;/p&gt;

&lt;p&gt;And enums let you define an Array of values for an attribute and refer to them by name&lt;/p&gt;

&lt;p&gt;I am sure I could explain better but I think I need more practice to give a more profound explanation. but basically both will help us save time by not writing and writing code, is like we will have access to these values because we will put a name on them&lt;/p&gt;

&lt;p&gt;I'll continue tomorrow cause I am SLEEPy&lt;/p&gt;

&lt;p&gt;xoxoxoxox&lt;/p&gt;

&lt;p&gt;Yours truly&lt;/p&gt;

&lt;p&gt;Sinhue&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>needtosleepmore</category>
    </item>
    <item>
      <title>In the middle of the night, I go g acm-ing in my sleep</title>
      <dc:creator>SinhueHerrera90</dc:creator>
      <pubDate>Thu, 17 Aug 2023 07:06:50 +0000</pubDate>
      <link>https://dev.to/sinhueherrera90/in-the-middle-of-the-night-i-go-g-acm-ing-in-my-sleep-539e</link>
      <guid>https://dev.to/sinhueherrera90/in-the-middle-of-the-night-i-go-g-acm-ing-in-my-sleep-539e</guid>
      <description>&lt;p&gt;Okay that's a song that I've been listening to that my mom used to play when we were younger, is called The River of Dreams by Billy Joel &lt;/p&gt;

&lt;p&gt;Anyway, I'm here, writing this in the middle of the night while I wrap my head around some of the things that I have learned while working on this photogram project&lt;/p&gt;

&lt;p&gt;First off, and something I forgot to mention on my previous post, the g acm "Name your changes" command has been quite helpful, I think it saves time and energy that can be used to have the brain checking for the many typos I usually get on my code&lt;/p&gt;

&lt;p&gt;Secondly, when working with data associations, for every belongs_to there has to be a has_many (at least in most of the cases I guess), which of course makes sense, the way I understand this is, let's say there's a script I wrote, that script belongs_to me, however, since I wouldn't have just one, then I would say Sinhue has_many scripts&lt;/p&gt;

&lt;p&gt;I also learned that if when adding a column to a data table, we don't necessarily have to write the correct name when writing the command AddNameofColumnnntoTable column_name:data_type; note how I wrote Name of Column vs column_name, this is because once we write the name and the data type, ruby will understand what name to actually put on the column (at least that's how I understood)&lt;/p&gt;

&lt;p&gt;Another VERY helpful thing I learned, is that we can change the default value of a column, for example in our exercise, we have a column in a table called USERS, this column refers to the status of an user (private, and it's a boolean), so since I want the default value for this column to be true, I will go ahead and write on my terminal:&lt;/p&gt;

&lt;p&gt;rails g migration AddDefaultToPrivate&lt;/p&gt;

&lt;p&gt;Then, on our migrations, I will go to this migration file and add the value there in this format:&lt;/p&gt;

&lt;p&gt;change_column_default(&lt;br&gt;
       table_name,&lt;br&gt;
       column_name,&lt;br&gt;
       default&lt;br&gt;
         )&lt;/p&gt;

&lt;p&gt;And of course, once we wrote the changes, we can execute the migration with rails db:migrate&lt;/p&gt;

&lt;p&gt;I wonder if I can use that to set up the default value of a column which data type is an integer to 0, since I forgot to add it when creating my data model, I guess I'll have to try it&lt;/p&gt;

&lt;p&gt;I also learned about counter_cache, which is used to keep track of the number of associated records in a relationship using a counter column, this is helpful for us, specially as we enter more and more data into our data bases&lt;/p&gt;

&lt;p&gt;I am not even halfway through the project and I feel like there's so much information to continue learning, I will update soon as I continue working on it&lt;/p&gt;

&lt;p&gt;For now I have to go to sleep DAHLINGS, please feel free to add comments or corrections &lt;/p&gt;

&lt;p&gt;xoxoxo&lt;/p&gt;

&lt;p&gt;by yours truly&lt;/p&gt;

&lt;p&gt;Sinhue&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A month later, HERE I AM</title>
      <dc:creator>SinhueHerrera90</dc:creator>
      <pubDate>Fri, 11 Aug 2023 05:32:19 +0000</pubDate>
      <link>https://dev.to/sinhueherrera90/a-month-later-here-i-am-4okj</link>
      <guid>https://dev.to/sinhueherrera90/a-month-later-here-i-am-4okj</guid>
      <description>&lt;p&gt;So, tonight as I am taking back my studying on Ruby on Rails, I was working on a project similar to Instagram, because of the nature of the data model (with users, photos, likes, comments, requests) it is imperative to know how to create the right schema so that my tables work correctly with each other (at least that's how I understand it, please give me feedback if you can explain it better)&lt;/p&gt;

&lt;p&gt;So, as I was working on adding my data tables, I realized I made a couple of mistakes, mainly on defining some of the relations that tables have with each other, even though I had already done this before, it was good to remember that sometimes we have to define where our foreign key is coming from, for example, let's say I have a data table for comments, and it references (which is a keyword for associations between two data tables) an :author, I will have to establish where this author is coming from(the foreign key) so a snippet of code on a comments migration that has a connection to a user table through "author" would look like this:&lt;/p&gt;

&lt;p&gt;"... t.references :author, null: false, foreign_key: { to_table: :users} ..."&lt;/p&gt;

&lt;p&gt;This code of course also takes in account that we want to have an author to each comment (and hence the null:false)&lt;/p&gt;

&lt;p&gt;So, all this explanation (or attempt to explain) is just to mention that, after I realized I made a mistake on two of my tables, I had to go back to my previous two migrations, I knew I could do a rails db:rollback to go back to my last migration, so I did that, but then I noticed I had to go back two steps further (or behind should I say) and so I used the rails db:rollback STEP=2 to solve this (it seems like you can go step by step, LITERALLY, when going back to your migrations)&lt;/p&gt;

&lt;p&gt;I hadn't really worked with rolling back past my last migration, it seems like this worked 🫣&lt;/p&gt;

&lt;p&gt;Anyway, it's a bit late and I am falling asleep, I will check that everything goes smooth with this project and I will continue updating as I work through it&lt;/p&gt;

&lt;p&gt;I hope this can help someone or that at least is readable ha ha&lt;/p&gt;

&lt;p&gt;See ya!&lt;/p&gt;

&lt;p&gt;Sinhue&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Started using routes helpers on Ruby</title>
      <dc:creator>SinhueHerrera90</dc:creator>
      <pubDate>Sat, 01 Jul 2023 06:51:20 +0000</pubDate>
      <link>https://dev.to/sinhueherrera90/started-using-routes-helpers-on-ruby-1j8g</link>
      <guid>https://dev.to/sinhueherrera90/started-using-routes-helpers-on-ruby-1j8g</guid>
      <description>&lt;p&gt;So after a couple of months of nos posting anything, I am coming back to post about something I've learned today that I think it will really simplify the way I write/understand code&lt;/p&gt;

&lt;p&gt;As a new software developer, I am currently learning Ruby and Ruby on rails, I was taught how to write routes the old way &lt;/p&gt;

&lt;p&gt;get("/route_name", {:controller =&amp;gt; "controller_name", :action =&amp;gt; "action_name"})&lt;/p&gt;

&lt;p&gt;Now, after learning about helper methods, I got a lot of things that can be changed for efficiency and save time, for example, now my routes will look like this (as they should)&lt;/p&gt;

&lt;p&gt;post "/movies" =&amp;gt; "movies#create", as: :movies&lt;/p&gt;

&lt;p&gt;Now I learned that ruby automatically uses a prefix to create methods that we can later use on for static routes on our html templates,the syntax looks like this (in this case using the route "/movies" as an example) movies_path (there is also a method we can use with _url ending instead of _path, but that is to be used only for us when sending responses back, usually on our controllers)&lt;br&gt;
For a dynamic route, we can use the same syntax after naming our route, but since it's a dynamic route, it will expect an argument, for example, let's say that in our previous route we have a dynamic route called edit that we named edit_movie_path, we would write on our html template:&lt;/p&gt;

&lt;p&gt;edit_movie_path(the argument we want to display)&lt;/p&gt;

&lt;p&gt;Naming our routes is an extremely useful feature, because in the future, if we need to change the route name itself, instead of going to each view template where the route is called and look one by one, we can just use our prefixed methods for routing, or we can use the names we give for our dynamic routes.&lt;/p&gt;

&lt;p&gt;I also learned that we don't necessarily have to call the whole view template if the action name matches the template name, for example, instead of typing an action called index on a controller called Comments like this:&lt;/p&gt;

&lt;p&gt;render({ :template =&amp;gt; "comments/index.html.erb"})&lt;/p&gt;

&lt;p&gt;We can just simply write it like this:&lt;/p&gt;

&lt;p&gt;render "comments/index" without specifying the html.erb, since ruby will take as first format an html.erb (if we were to render a different format, then we would have to write the extension)&lt;/p&gt;

&lt;p&gt;What's even better is that we DON'T HAVE TO EVEN CALL THE RENDER METHOD AT ALL if the folder name matches the controller name and the template matches the action name, in this case we would just write the action and the render would happen by itself (we still need to create something to render, of course)&lt;/p&gt;

&lt;p&gt;Another thing I learned was how to replace the &lt;a&gt; element from html with a ruby helper method called link_to&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically, the way it works is like this, we write on out html the Ruby tags &amp;lt;%= link_to "Whatever we want to display as the text for the link, the link%&amp;gt;&lt;/p&gt;

&lt;p&gt;Using our previous examples on routing, we can actually call for a route method or link when using the link_to helper method, for example&lt;/p&gt;

&lt;p&gt;&amp;lt;%=link_to "Add a new movie", new_movie_path%&amp;gt;&lt;/p&gt;

&lt;p&gt;Let's say that we have an active record object for which we want to show the .id method, we don't have to call for it, as ruby will assume that is what we want to retrieve.&lt;/p&gt;

&lt;p&gt;We can also drop the .id method whenever we want to retrieve it as Ruby will automatically think that's the information we want to display to the user.&lt;/p&gt;

&lt;p&gt;Lastly, I learned the new way of writing structure in Ruby, for example, we can remove {} when the last argument of a method is given, and we can also remove the () if the order of factors wouldn't affect our code.&lt;/p&gt;

&lt;p&gt;Overall, this has been an amazing chapter that I am sure will ease my work on future projects, and somehow it's making everything make more sense to me.&lt;/p&gt;

&lt;p&gt;Long post, I know but I was pretty excited about it, I'll probably will come back to edit cause I know there's some stuff I could explain better, but for now, I am happy with it&lt;/p&gt;

&lt;p&gt;XOXO&lt;/p&gt;

&lt;p&gt;Sinhue&lt;/p&gt;

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