<?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: javier</title>
    <description>The latest articles on DEV Community by javier (@javirodmart).</description>
    <link>https://dev.to/javirodmart</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%2F974569%2F430fac48-7cac-454b-8f85-9ca1d073b6fe.jpeg</url>
      <title>DEV Community: javier</title>
      <link>https://dev.to/javirodmart</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/javirodmart"/>
    <language>en</language>
    <item>
      <title>Using rails generator to create you table models</title>
      <dc:creator>javier</dc:creator>
      <pubDate>Fri, 17 Feb 2023 06:06:37 +0000</pubDate>
      <link>https://dev.to/javirodmart/using-rails-generator-to-create-you-table-models-5770</link>
      <guid>https://dev.to/javirodmart/using-rails-generator-to-create-you-table-models-5770</guid>
      <description>&lt;p&gt;Ruby on rails makes creating table models super easy. In order to create a table model, you need to first go into your terminal. Start the command with: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;rails g&lt;/code&gt; &lt;br&gt;
"g" stands for generate. After you create your table, you have to name it. For example, if I wanted to created a table for restaurants I would type in something along the lines of:&lt;br&gt;
&lt;code&gt;rails g model Restaurants&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Next, you'll add your columns. Continuing with the restaurant example, most restaurants have a name, store number, and address. To add this information, just type in:&lt;br&gt;
&lt;code&gt;rails g model Restaurant name store_number:integer address&lt;/code&gt;&lt;br&gt;
rails by default rails will assume you want your column to be a string so you won't have to type anything after you've named your columns. Saying that, you'll notice that for store number I added :integer. If you want your column to be something besides a string, you'll have to specify that. &lt;br&gt;
After that, you should get this in your terminal: &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faiviwqmc8sqpzbpcwxh9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faiviwqmc8sqpzbpcwxh9.png" alt=" " width="800" height="101"&gt;&lt;/a&gt;&lt;br&gt;
then check your app file, go into models, and your restaurant.rb should be there. Also go to your db file, then into migrate; your migration should be there all set up like so:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9s7cnjjbjxmri5z9ko31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9s7cnjjbjxmri5z9ko31.png" alt=" " width="800" height="648"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Rails has many more generators that can be useful. This just the tip of the iceberg. This probably my favorite part of rails. It makes coding a lot faster and more efficient. Let us focus on more complex and personalized code.&lt;/p&gt;

&lt;p&gt;Like even creating the whole MVP. Using the resource generator not only creates your model but also your controller, your serializers , and your routes. Not including your associations. Which will set up your micros in your table that connects with other tables or your belongs_to but you will have to set up your has_many on your own. &lt;br&gt;
The best part being that it is super easy to fallow and learn. So need to worry if it be hard to learn or not or even worth your time. Which obviously it is most definitely worth it. &lt;br&gt;
 You can find all the information &lt;a href="https://guides.rubyonrails.org/command_line.html#bin-rails-generate" rel="noopener noreferrer"&gt;&lt;/a&gt; ruby has great guides so I definitely recommend looking into the guides.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>welcome</category>
    </item>
    <item>
      <title>Creating A Carousel In React With Bootstrap</title>
      <dc:creator>javier</dc:creator>
      <pubDate>Fri, 09 Dec 2022 07:12:38 +0000</pubDate>
      <link>https://dev.to/javirodmart/creating-a-carousel-in-react-with-bootstrap-3f0p</link>
      <guid>https://dev.to/javirodmart/creating-a-carousel-in-react-with-bootstrap-3f0p</guid>
      <description>&lt;p&gt;Creating a carousel in react might sound a bit intimidating; but with the right tools and background knowledge, it becomes much easier. First, we'll start by installing Bootstrap with npm.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install react-bootstrap bootstrap&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After you have installed Bootstrap, you will need to import it into your JS.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import Carousel from 'react-bootstrap/Carousel';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now let's get to the fun part. You'll want do use the following code to create your carousel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;Carousel&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://cdn.mos.cms.futurecdn.net/MeU4HokrzUwhbd9PJBQCSV-1200-80.png'/&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://fs-prod-cdn.nintendo-europe.com/media/images/10_share_images/games_15/nintendo_switch_download_software_1/2x1_NSwitchDS_Overwatch2WatchpointPack_image1600w.jpg'/&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://i.ytimg.com/vi/wQATS4HOxdo/maxresdefault.jpg'/&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://p325k7wa.twic.pics/high/elden-ring/elden-ring/04-retailers/00-beautyshots/04-Standard/ER_standard_keyart.jpg?twic=v1/step=10/quality=80/max=760'/&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://cdn.cloudflare.steamstatic.com/steam/apps/570940/capsule_616x353.jpg?t=1668145065'/&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://images2.alphacoders.com/204/thumb-1920-204972.jpg'/&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://i.ytimg.com/vi/H4rYVsJ4v9Y/maxresdefault.jpg'/&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div className='slide'&amp;gt;&amp;lt;img src='https://cdn.akamai.steamstatic.com/steam/apps/12210/capsule_616x353.jpg?t=1618853493'/&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/Carousel&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Personally, I recommend putting the carousel in its own component in case you need to use it in different places throughout your app. Putting it in its own component will also make it significantly easier to see what the placement will look like in your app.&lt;/p&gt;

&lt;p&gt;After that, you're pretty much done. This will give you the basic foundation for your carousel. It can be customized to your liking by changing fonts, speeds, styles, transitions, and image size. I recommend playing around with these to see what you prefer and what works best with your personal style and project. You can use this for a slide show or even a loading page if you wanted to. Happy coding!&lt;/p&gt;

</description>
      <category>twitter</category>
    </item>
    <item>
      <title>Working with the Spotify Api as a student in JavaScript</title>
      <dc:creator>javier</dc:creator>
      <pubDate>Fri, 18 Nov 2022 01:54:35 +0000</pubDate>
      <link>https://dev.to/javirodmart/working-with-the-spotify-api-as-a-student-in-javascript-2kod</link>
      <guid>https://dev.to/javirodmart/working-with-the-spotify-api-as-a-student-in-javascript-2kod</guid>
      <description>&lt;p&gt;As a person who is semi-new to coding, tapping in to the Spotify Api might seem pretty intimating. Trust me, it was, but once you break it down it's actually not too hard and absolutely cool to work with. If you do any project with music I highly recommend using it. My first challenge was actually getting data from the Api. This was definitely a blocker since I haven't worked with an Api with that needs any kind of token or authorization. This was solved with 2 days of research and few trips to stack overflow. To get onto Spotify's Api you really just have to get your Fetch headers right like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
            'Authorization':  `Bearer ` + token
        }     
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although using a token isn't super efficient, I haven't quite figured out a way around it, since the token is only good for 60 minutes. I'll definitely have an update for you when I do figure that part out.&lt;br&gt;
 Depending on what kind of data you're trying to get from the Api will determine what your fetch link will be. The base of the link will start looking something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://api.spotify.com/v1/"&gt;https://api.spotify.com/v1/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I personally was playing around with looking for artist data so my link went a little like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://api.spotify.com/v1/artists&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you run your fetch like this it will give you an error. So after artists, you will have to specify which artists you are looking for with their unique id, which you can find in the Spotify web browser in the link when you look up an artist like so : &lt;/p&gt;

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

&lt;p&gt;After that, I recommend console logging your results to make sure you have the results you're looking for (console log everything !!!!). I did a group project in my cohort which honestly I am very impressed with. Make sure you go check it out!!!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/javirodmart/phase1ProjectJTK"&gt;https://github.com/javirodmart/phase1ProjectJTK&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;If you do decide to check it make sure you put in a new token!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>api</category>
    </item>
  </channel>
</rss>
