<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sekou Dosso on Medium]]></title>
        <description><![CDATA[Stories by Sekou Dosso on Medium]]></description>
        <link>https://medium.com/@sekou-dosso82-17502?source=rss-c2305751345------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*hf8nIg-6CEvvZGDe_elQTw.jpeg</url>
            <title>Stories by Sekou Dosso on Medium</title>
            <link>https://medium.com/@sekou-dosso82-17502?source=rss-c2305751345------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:50:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sekou-dosso82-17502/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Nested Resources In Rails.]]></title>
            <link>https://sekou-dosso82-17502.medium.com/nested-resources-in-rails-560441729ac5?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/560441729ac5</guid>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ruby-on-rails-development]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Mon, 08 Mar 2021 13:37:13 GMT</pubDate>
            <atom:updated>2021-03-08T13:37:13.721Z</atom:updated>
            <content:encoded><![CDATA[<p>I came across with a challenge to build nested route in rails, and I believe that this post can help other junior like myself. The challenge was about to set up a nested route for 3 controllers where: Dog is child of Owner and Meal is a child of Dog. Also, with 2 grouped routes admin and reports.</p><p>Objectives:</p><p>- Understand the value of nested routes</p><p>- Create nested routes</p><ul><li>Understand how nested resource URL helper are named.</li></ul><p>Regular URL</p><p>In a regular URL we might imagine the following possible URLs .</p><p>get ‘admin/owners’, to: ‘owners#index’</p><p>get ‘admin/owners/:id/dogs’, to: ‘dogs#index’</p><p>get ‘admin/owners/:id/dogs/:id’, to: ‘dogs#show’</p><p>get ‘admin/owners/:id/dogs/:id/meals’, to: ‘meals#show’</p><p>get ‘admin/owners/:id/dogs/:id/meals/:id’, to: ‘meals#show’</p><p>as we see now we are getting into messy territory. But base of the separation of concern in order to retrieve a specif. meal we really don’t need owner, we only need dog.</p><p>Fortunately Just like any other resourced route, Rails provides named helpers for our nested routes as well. And, just like most other things Rails provides, there’s a predictable way to figure out what they are.</p><p>We can nest resources more than one level deep in rails like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*gowb7a7DGtcbNxb8hSNvLw.png" /></figure><p>Recap: we have 2 namespaces (admin and reports) for which we need to set up they different routes where dog is child of owner and meal is a child of dog. With the previous nested resources, we are getting a very long and ugly URL.</p><p>Recap: we have 2 namespaces (admin and reports) for which we need to set up they different routes.</p><p>We will have to work on 3 steps. Route, Controllers and views</p><p>In config/route we can nest resources as the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*7QvsNnGaoO1GlXSjlCDztw.png" /></figure><p>To make things less confusing, <a href="https://guides.rubyonrails.org/routing.html#nested-resources">Rails has a shallow option</a> you can add to nested routes. So with the shallow option, you would do</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*mC6YL334OA7ELcbzc2klcw.png" /></figure><p><strong>Controllers</strong></p><p>In the controller we will have to create our 2 namespaces folders</p><p>Controller/admin</p><p>Controller/reports</p><p>When you create a new folder under /controllers, Rails will automatically pick that up as a module and expect you to namespace the controller accordingly. We need to modify our admin/owners.rb to look like this:</p><p><strong>Controllers/Admin/dogs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*y0zFC6CfbYnmsJuO8qr2KA.png" /></figure><p><strong>Controllers/Reports/dogs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*Kz4QZRk6KCg1u0vP8Wv94Q.png" /></figure><p><strong>Views</strong></p><p>The views folder for a controller module (in this case /admin) expects a subfolder structure that matches the names of the controllers (in this case views/admin/owners).</p><p>Views/admin/owners/new.html.erb</p><p>Views/reports/dogs/new.html.erb</p><p><strong>Summary</strong></p><p>Nesting resources is a powerful tool that helps you keep your routes neat and tidy and is better than dynamic route segments for representing parent/child relationships in your system.</p><p>However, as a general rule, you should only nest resources one level deep and ensure that you are considering Separation of Concerns in your routing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=560441729ac5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Redux Redux-thunk essential]]></title>
            <link>https://sekou-dosso82-17502.medium.com/react-redux-redux-thunk-essential-a3857571ee5c?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3857571ee5c</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[thunk]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Sun, 17 Jan 2021 15:27:13 GMT</pubDate>
            <atom:updated>2021-02-25T20:12:03.523Z</atom:updated>
            <content:encoded><![CDATA[<p>React Redux Redux-thunk essential</p><p>This blog post will explain the basic of understanding React Redux concept.</p><p>In order to avoid passing props down to components in React, Redux is very helpful to manage the states. It is similar to a cycle. Only 3 steps to master. You must have a reducer(store), set up you index.js to make store available to your app finally connect the component that need states within your store.</p><p><strong>Initial set up</strong></p><pre>npm install --save create-store</pre><pre>npm install –save redux react-redux / yarn add react-redux</pre><pre>npm install --save redux-thunk</pre><p><strong>IN INDEX.JS</strong></p><p>Import createStore, import provider, import recuder, and Import thunk.</p><p>Define a var and assign crearteStroe(reducer)</p><p>send your var into provider to make it available to whole app</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d_3LzOdQqfqfNZ-0t6mRTA.png" /></figure><p>IN <strong>APP</strong>.JS</p><p>. Import connect .</p><p>. import your store method that you need . Here we need fetchDeliversCreator. In this case let say you want to make your initial fetch available to your whole app then you can use componentDidMount()</p><p>. Map your necessary states to your Redux store which is located in your reducer.</p><p>. Set your Map Dispatch to Props action is you need it. In this case we need to dispatch fetchDelivers in our componentDidMount.</p><p>. export default connect(mapStateToProps, mapDispatchToProps)(App);</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aw8X_ue7k7y0DjQb5_J_Vg.png" /><figcaption>you can console.log tosee you App.js props properties</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*gvKPIzAWxv8Bbo4NgYwflw.png" /></figure><p>IN REDUCER.JS</p><p>Only 3 steps you need to master.</p><p>. Initial state (add only the states that 2 or more components are sharing.</p><p>. Methods or const you need to export (this make them to be import in other components)</p><p>. Reducer you need to export ( this make the reducer to be import in index.js to create your Redux store)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HfmiW7JSVRHtQQUW2frd7Q.png" /></figure><p><strong>About thunk:</strong></p><p><a href="https://en.wikipedia.org/wiki/Thunk">Thunk</a> is a programming concept where a function is used to delay the evaluation/calculation of an operation.</p><p>Redux Thunk is a middleware that lets you call action creators that return a function instead of an action object. That function receives the store’s dispatch method, which is then used to dispatch regular synchronous actions inside the function’s body once the asynchronous operations have been completed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3857571ee5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby Enumerables: ‘any’, ‘all’, ‘none’, and ‘find’]]></title>
            <link>https://sekou-dosso82-17502.medium.com/ruby-enumerables-any-all-none-and-find-306d704badda?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/306d704badda</guid>
            <category><![CDATA[ruby-on-rails-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Wed, 11 Nov 2020 14:28:22 GMT</pubDate>
            <atom:updated>2020-11-11T14:28:22.285Z</atom:updated>
            <content:encoded><![CDATA[<p>Ruby offers various enumerables on collections that check for validity of the objects within it.</p><p>Consider the following example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiSK819FpE3WQN8bO8uVpA.png" /></figure><p>The any? method returns true if the block ever returns a value other than false or nil for any element passed to it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cT9MDgb7AsLS3vBkWFBncw.png" /></figure><p>The all? method returns true if the block never returns false or nil for any element passed to it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qBua_ZvQO7Xuv1vppi4CuA.png" /></figure><p>The none? method returns true if the block never returns true for any element passed to it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jhbYHRRm8BmxeO36g4Q1sg.png" /></figure><p>The find method returns the first element for which block is not false:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*llkV3sS9yd8wAD-FekmysQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=306d704badda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rub Array Essential]]></title>
            <link>https://sekou-dosso82-17502.medium.com/rub-array-essential-7c6a5148e3be?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c6a5148e3be</guid>
            <category><![CDATA[ruby-on-rails-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Wed, 04 Nov 2020 15:25:40 GMT</pubDate>
            <atom:updated>2020-11-04T15:25:40.222Z</atom:updated>
            <content:encoded><![CDATA[<p>arr = [9, 5, 1, 2, 3, 4, 0, -1]</p><h4>access index</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*2mqcRkxxIrRuhQ-1BtbFDw.png" /></figure><h4>inclusive and exclusive range</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJ9shUDLwNbUe0V_MsBG9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*os7qPopIeeymt5vUNyeM6w.png" /></figure><p>To access the elements from the end of the list, we can use negative indices.</p><p>arr = [9, 5, 1, 2, 3, 4, 0, -1]</p><h4>last element</h4><p>arr[-1] =&gt; -1</p><p>or</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xONejdl-rlhIPyk72c5SZw.png" /></figure><p>The last element of the array can be accessed using</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HK2h6xmg6IOa5KxKugmP7Q.png" /></figure><h4>FIRST element</h4><p>The first n elements of the array can be accessed using</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4o8n_ClkRiXAdVKqE15KkA.png" /></figure><p>Everything but the first n elements of the array can be accessed using</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPdM5lD5dj9Jd6QNoKiQmw.png" /></figure><h4>PUSH</h4><p>push allows one to add an element to the end of the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cu0YYYRdyoid0Qs4CYbtZQ.png" /></figure><h4>INSERT</h4><p>insert allows one to add one or more elements starting from a given index (shifting elements after the given index in the process).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCKeeJojNw2WNuf1l4CCPQ.png" /></figure><h4>UNSHIFT</h4><p>unshift allows one or more elements to be added at the beginning of the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3p-FUQTLEaBNjSx-4YRsOQ.png" /></figure><h4>DELETE FROM ARRAY</h4><p>arr = [5, 6, 5, 4, 3, 1, 2, 5, 4, 3, 3, 3]</p><p>Delete an element from the end of the array</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mBku4nlQ6vrxnJQo85g_Wg.png" /></figure><p>Delete an element from the beginning of the array</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IkDumtlBblQyYZuZxL82yQ.png" /></figure><p>Delete an element at a given position</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoBrk3mLcA_sgfKM4YUXlg.png" /></figure><p>Delete all occurrences of a given element</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbpHXKhaPUKbJehB9RyALQ.png" /></figure><p>Non-Destructive Selection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xs6SZ7J9whIGOF2EbTQHsA.png" /></figure><p>destructive behavior (change to the original array)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cqr_lyk-uUK3XmgTwaquvw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c6a5148e3be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[For each, Map, Collect, Select,Find_all, Find, Reduce in Ruby]]></title>
            <link>https://sekou-dosso82-17502.medium.com/for-each-map-collect-select-find-all-find-reduce-in-ruby-4528d1eb5a27?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/4528d1eb5a27</guid>
            <category><![CDATA[ruby-on-rails-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[rub]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Mon, 26 Oct 2020 15:01:13 GMT</pubDate>
            <atom:updated>2020-10-26T15:01:13.783Z</atom:updated>
            <content:encoded><![CDATA[<h3>FOR EACH</h3><p>The each iterator returns all the elements of an array or a hash.Executes code for each element in collection. Here, collection could be an array or a ruby hash.</p><p>It’s does not alter the original argument</p><p>Syntax</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8tcuSbp0GhTreCB-jkAjA.png" /></figure><h3>MAP</h3><p>Map is a Ruby method that you can use with Arrays, Hashes &amp; Ranges.The main use for map is to TRANSFORM data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0LNtQcYLe3BdkZNs7poPUg.png" /></figure><h3>Ruby Map vs Each</h3><p>What is the difference between map &amp; each?</p><p>Each is like a more primitive version of map…</p><p>It gives you every element so you can work with it, but it doesn’t collect the results. Each always returns the original, unchanged object.</p><p>While map does the same thing, but… It returns a new array with the transformed elements.</p><h3>Ruby Map vs Collect</h3><p>Map and Collect are exactly the same method.</p><p>They are different names for the same thing!</p><h3>COLLECT</h3><p>Array#collect() : collect() is an Array class method which invokes the argument block once for each element of the array. A new array is returned which has the value returned by the block.</p><h4>Syntax:</h4><p>Array.collect()</p><p>Parameter: Arrays in which we want elements to be invoked</p><p>Return: array with all the invoked elements</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQNKv7SwPbID7ztNCkk-rQ.png" /></figure><h3>Select / FIND_ALL</h3><p>SELECT or FIND_ALL is best used when you need to iterate over an array or hash but only need the elements that return true when tested.</p><p>SELECT and FIND_ALL are basically identical when it comes to working with arrays.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RfGsaQMB83sIsZV8GRmohw.png" /></figure><h3>Important</h3><p>When it comes to iterating over hashes, this is when we see the difference between .select and .find_all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nXgPg439IY9agHiDRd3NA.png" /></figure><p>Notice how in the above example how both the .</p><p>select and .find_all return the same key:value pairings but</p><p>.select returns the value in the form of the original input which in this case is a hash. But we can see that .</p><p>.find_all return the key:value pairing in an array.</p><h3>FIND</h3><p>find(p1 = v1) public</p><p>Passes each entry in enum to block.</p><p>RETURNS THE FIRST FOR WHICH BLOCK IS NOT FALSE</p><p>If no object matches, calls ifnone and returns its result when it is specified, or returns nil otherwise.</p><p>If no block is given, an enumerator is returned instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5RDC5J4_k0iizoFJi4R7tQ.png" /></figure><h3>SELECT vs FIND</h3><p>The .find method</p><p>This Ruby method iterates through an array and gives you the first match for which the expression within a block returns true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VHGoeyEkEeO4I1Kk74mhCg.png" /></figure><h3>The .select method</h3><p>The .select method iterates on an array or hash and returns an array or hash (depending on the datatype) of all values that evaluate as true given a block of code.</p><p>This method is great when you want to filter a list and only return values that match certain conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFBHcGrhoMMafFxctNjPtg.png" /></figure><p>array containing all elements of array for which the given block returns a true value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqZ-43gCAJTSDsFfv-Azrg.png" /></figure><h3>REDUCE</h3><p>The ‘reduce’ method can be used to take an array and reduce it to a single value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJ-7LANortENWq3ipEEwUA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4528d1eb5a27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Record Basics]]></title>
            <link>https://sekou-dosso82-17502.medium.com/active-record-basics-76cd76130b4f?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/76cd76130b4f</guid>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[rails-6]]></category>
            <category><![CDATA[activerecord]]></category>
            <category><![CDATA[ruby-on-rails-development]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Mon, 19 Oct 2020 23:26:00 GMT</pubDate>
            <atom:updated>2020-10-19T23:26:00.344Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Active Record</strong></p><p>Active Record is the M in <a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">MVC</a> — the model — which is the layer of the system responsible for representing business data and logic. Active Record facilitates the creation and use of business objects whose data requires persistent storage to a database. It is an implementation of the Active Record pattern which itself is a description of an Object Relational Mapping system.</p><p><strong>The Active Record pattern</strong></p><p>An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.</p><p>An object carries both data and behavior. Much of this data is persistent and needs to be stored in a database. Active Record uses the most obvious approach, putting data access logic in the domain object. This way all people know how to read and write their data to and from the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*NpH918F_PM9N3-ot6Lrqkw.png" /></figure><p><strong>Object Relational Mapping</strong></p><p><a href="https://en.wikipedia.org/wiki/Object-relational_mapping">Object Relational Mapping</a>, commonly referred to as its abbreviation ORM, is a technique that connects the rich objects of an application to tables in a relational database management system. Using ORM, the properties and relationships of the objects in an application can be easily stored and retrieved from a database without writing SQL statements directly and with less overall database access code.</p><p>Note: <strong><em>Basic knowledge of relational database management systems (RDBMS) and structured query language (SQL) is helpful in order to fully understand Active Record.</em></strong></p><p><strong>Active Record as an ORM Framework</strong></p><p>Active Record gives us several mechanisms, the most important being the ability to:</p><ul><li>Represent models and their data.</li><li>Represent associations between these models.</li><li>Represent inheritance hierarchies through related models.</li><li>Validate models before they get persisted to the database.</li><li>Perform database operations in an object-oriented fashion.</li></ul><p><strong>Naming Convention</strong></p><p>By default, Active Record uses some naming conventions to find out how the mapping between models and database tables should be created. Rails will pluralize your class names to find the respective database table. So, for a class Book, you should have a database table called <strong>books</strong>. The Rails pluralization mechanisms are very powerful, being capable of pluralizing (and singularizing) both regular and irregular words. When using class names composed of two or more words, the model class name should follow the Ruby conventions, using the CamelCase form, while the table name must contain the words separated by underscores. Examples:</p><ul><li>Model Class — Singular with the first letter of each word capitalized (e.g., BookClub).</li><li>Database Table — Plural with underscores separating words (e.g., book_clubs).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*98SOTeBZbAgxl7oA8ew-Og.png" /></figure><p><strong>Schema Conventions</strong></p><p>Active Record uses naming conventions for the columns in database tables, depending on the purpose of these columns.</p><ul><li><strong>Foreign keys</strong> — These fields should be named following the pattern singularized_table_name_id (e.g., item_id, order_id). These are the fields that Active Record will look for when you create associations between your models.</li><li><strong>Primary keys</strong> — By default, Active Record will use an integer column named id as the table’s primary key (bigint for PostgreSQL and MySQL, integer for SQLite). When using <a href="https://guides.rubyonrails.org/active_record_migrations.html">Active Record Migrations</a> to create your tables, this column will be automatically created.</li></ul><p><strong>Creating Active Record Models</strong></p><p>It is very easy to create Active Record models. All you have to do is to subclass the ApplicationRecord class and you’re good to go:</p><p>class User &lt; ApplicationRecord</p><p>end</p><p>Rails has a nice syntax to generate model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNbR1zUHkpyeD5ugmN9spw.png" /></figure><pre>example: rails generate model User username:string password:string</pre><p>Above will create a User model, mapped to a User table at the database. By doing this you&#39;ll also have the ability to map the columns of each row in that table with the attributes of the instances of your model.</p><p><strong>Migrations</strong></p><p>Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record supports using rake. Here&#39;s a migration that creates a table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*xcaoN2EdOsyVjR3q6yldcw.png" /></figure><p>Rails keeps track of which files have been committed to the database and provides rollback features. To actually create the table, you’d run rails db:migrate and to roll it back, rails db:rollback.</p><p>Note that the above code is database-agnostic: it will run in MySQL, PostgreSQL, Oracle, and others. You can learn more about migrations in the <a href="https://guides.rubyonrails.org/active_record_migrations.html">Active Record Migrations guide</a>.</p><p><strong>Validations</strong></p><p>Active Record allows you to validate the state of a model before it gets written into the database. There are several methods that you can use to check your models and validate that an attribute value is not empty, is unique and not already in the database, follows a specific format, and many more.</p><p>Validation is a very important issue to consider when persisting to the database, so the methods save and update take it into account when running: they return false when validation fails and they don&#39;t actually perform any operations on the database. All of these have a bang counterpart (that is, save! and update!), which are stricter in that they raise the exception ActiveRecord::RecordInvalid if validation fails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*rHceo-UQknAxv2IDZgowYg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76cd76130b4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Component Lifecycle]]></title>
            <link>https://sekou-dosso82-17502.medium.com/the-component-lifecycle-f394d421342?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/f394d421342</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Mon, 12 Oct 2020 17:15:54 GMT</pubDate>
            <atom:updated>2020-10-12T17:15:54.062Z</atom:updated>
            <content:encoded><![CDATA[<p>Each component in React has a lifecycle which you can monitor and manipulate during its three main phases. The three phases are: <strong>Mounting</strong>, <strong>Updating</strong>, and <strong>Unmounting</strong>.</p><p>Each component has several “lifecycle methods” that you can override to run code at particular times in the process. <strong>You can use </strong><a href="https://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/"><strong>this lifecycle diagram</strong></a><strong> as a cheat sheet.</strong> In the list below, commonly used lifecycle methods are marked as <strong>bold</strong>. The rest of them exist for relatively rare use cases.</p><p><strong>Mounting</strong></p><p>These methods are called in the following order when an instance of a component is being created and inserted into the DOM:</p><p>. Constructor</p><p>. getDerivedStateFromProps</p><p>. render</p><p>. componentDidMount</p><h3><strong>constructor()</strong></h3><h4>constructor(props)</h4><p><strong>If you don’t initialize state and you don’t bind methods, you don’t need to implement a constructor for your React component.</strong></p><p>The constructor for a React component is called before it is mounted. When implementing the constructor for a React.Component subclass, you should call super(props) before any other statement. Otherwise, this.props will be undefined in the constructor, which can lead to bugs.</p><p>Typically, in React constructors are only used for two purposes:</p><p>Initializing <a href="https://reactjs.org/docs/state-and-lifecycle.html">local state</a> by assigning an object to this.state.</p><p>Binding <a href="https://reactjs.org/docs/handling-events.html">event handler</a> methods to an instance.</p><p>You <strong>should not call setState()</strong> in the constructor(). Instead, if your component needs to use local state, <strong>assign the initial state to this.state</strong> directly in the constructor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*ZAb_IJGq8UCmCioGlBQLwg.png" /></figure><p>Constructor is the only place where you should assign this.state directly. In all other methods, you need to use this.setState() instead.</p><p>Avoid introducing any side-effects or subscriptions in the constructor. For those use cases, use componentDidMount() instead.</p><h3>getDerivedStateFromProps</h3><p>The getDerivedStateFromProps() method is called right before rendering the element(s) in the DOM.</p><p>This is the natural place to set the state object based on the initial props.</p><p>It takes state as an argument, and returns an object with changes to the state.</p><p>The example below starts with the favorite color being “red”, but the getDerivedStateFromProps() method updates the favorite color based on the favcol attribute:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*V9SMZHJRelWlzx2d2r_gzA.png" /></figure><h3><strong>render()</strong></h3><p>The render() method is required, and is the method that actually outputs the HTML to the DOM.</p><p>The render() method is the only required method in a class component.</p><p>When called, it should examine this.props and this.state and return one of the following types:</p><p><strong>React elements.</strong> Typically created via <a href="https://reactjs.org/docs/introducing-jsx.html">JSX</a>. For example, &lt;div /&gt; and &lt;MyComponent /&gt; are React elements that instruct React to render a DOM node, or another user-defined component, respectively.</p><p><strong>Arrays and fragments.</strong> Let you return multiple elements from render. See the documentation on <a href="https://reactjs.org/docs/fragments.html">fragments</a> for more details.</p><p><strong>Portals</strong>. Let you render children into a different DOM subtree. See the documentation on <a href="https://reactjs.org/docs/portals.html">portals</a> for more details.</p><p><strong>String and numbers.</strong> These are rendered as text nodes in the DOM.</p><p><strong>Booleans or null</strong>. Render nothing. (Mostly exists to support return test &amp;&amp; &lt;Child /&gt; pattern, where test is boolean.)</p><p>The render() function should be pure, meaning that it does not modify component state, it returns the same result each time it’s invoked, and it does not directly interact with the browser.</p><p>If you need to interact with the browser, perform your work in componentDidMount() or the other lifecycle methods instead. Keeping render() pure makes components easier to think about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*zqlkHHlFmdzJFnIWIzZTYA.png" /></figure><h3>componentDidMount()</h3><p>componentDidMount() is invoked immediately after a component is mounted (inserted into the tree). Initialization that requires DOM nodes should go here. If you need to load data from a remote endpoint, this is a good place to instantiate the network request.</p><p>This method is a good place to set up any subscriptions. If you do that, don’t forget to unsubscribe in componentWillUnmount().</p><p>You <strong>may call setState() immediately</strong> in componentDidMount(). It will trigger an extra rendering, but it will happen before the browser updates the screen. This guarantees that even though the render() will be called twice in this case, the user won’t see the intermediate state. Use this pattern with caution because it often causes performance issues. In most cases, you should be able to assign the initial state in the constructor() instead. It can, however, be necessary for cases like modals and tooltips when you need to measure a DOM node before rendering something that depends on its size or position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*cdl9tGaFw2rVTD6Q50oGXQ.png" /></figure><h3><strong>Updating</strong></h3><h3>componentDidUpdate()</h3><p>componentDidUpdate(prevProps, prevState, snapshot)</p><p>componentDidUpdate() is invoked immediately after updating occurs. This method is not called for the initial render.</p><p>Use this as an opportunity to operate on the DOM when the component has been updated. This is also a good place to do network requests as long as you compare the current props to previous props (e.g. a network request may not be necessary if the props have not changed).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*QPntTfafTtccs2yMnnybfg.png" /></figure><p>You <strong>may call setState() immediately</strong> in componentDidUpdate() but note that <strong>it must be wrapped in a condition</strong> like in the example above, or you’ll cause an infinite loop. It would also cause an extra re-rendering which, while not visible to the user, can affect the component performance. If you’re trying to “mirror” some state to a prop coming from above, consider using the prop directly instead. Read more about <a href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html">why copying props into state causes bugs</a>.</p><p>If your component implements the getSnapshotBeforeUpdate() lifecycle (which is rare), the value it returns will be passed as a third “snapshot” parameter to componentDidUpdate(). Otherwise this parameter will be undefined.</p><h3><strong>Unmounting</strong></h3><h4>componentWillUnmount()</h4><p>The next phase in the lifecycle is when a component is removed from the DOM, or <em>unmounting</em> as React likes to call it.</p><p>React has only one built-in method that gets called when a component is unmounted:</p><p>The componentWillUnmount method is called when the component is about to be removed from the DOM.</p><p>componentWillUnmount() is invoked immediately before a component is unmounted and destroyed. Perform any necessary cleanup in this method, such as invalidating timers, canceling network requests, or cleaning up any subscriptions that were created in componentDidMount().</p><p>You <strong>should not call setState()</strong> in componentWillUnmount() because the component will never be re-rendered. Once a component instance is unmounted, it will never be mounted again.</p><p>This method is called when a component is being removed from the DOM:</p><h3>Example:</h3><p>Click the button to delete the header:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*XpXy3Yj7zzibeh5mUxlf-Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f394d421342" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Forms]]></title>
            <link>https://sekou-dosso82-17502.medium.com/react-forms-2c595af5c091?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c595af5c091</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[components]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Mon, 05 Oct 2020 11:53:47 GMT</pubDate>
            <atom:updated>2020-10-05T11:53:47.507Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QceDVZhL9k-IpZTL37qikQ.png" /></figure><p>Handling <strong>forms</strong> is about how you handle the data when it changes value or gets submitted. In HTML, <strong>form</strong> data is usually handled by the DOM. In <strong>React</strong>, <strong>form</strong> data is usually handled by the components. When the data is handled by the components, all the data is stored in the component state .</p><p>Just like in HTML, React uses forms to allow users to interact with the web page.</p><h3>Adding Forms in React</h3><p>You add a form with React like any other element:</p><p>Example: Add a form that allows users to enter their name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*R9oGvtlT4Ckum-hsAFInMA.png" /></figure><h3>Handling Forms</h3><p>Handling forms is about how you handle the data when it changes value or gets submitted.</p><p>In HTML, form data is usually handled by the DOM.</p><p>In React, form data is usually handled by the components.</p><p>When the data is handled by the components, all the data is stored in the component state.</p><p>You can control changes by adding event handlers in the onChange attribute.</p><h3>Controlled Components</h3><p>In HTML, form elements such as &lt;input&gt;, &lt;textarea&gt;, and &lt;select&gt; typically maintain their own state and update it based on user input. In React, mutable state is typically kept in the state property of components, and only updated with <a href="https://reactjs.org/docs/react-component.html#setstate">setState()</a>.</p><p>We can combine the two by making the React state be the “single source of truth”. Then the React component that renders a form also controls what happens in that form on subsequent user input. An input form element whose value is controlled by React in this way is called a “controlled component”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*tfehFqiDrKe86rzbSRQElg.png" /></figure><p>You must initialize the state in the constructor method before you can use it.</p><p>You get access to the field value by using the event.target.value syntax.</p><p>With a controlled component, the input’s value is always driven by the React state. While this means you have to type a bit more code, you can now pass the value to other UI elements too, or reset it from other event handlers.</p><h3>Handling single Input or Multiple Inputs</h3><p>You can control the values of more than one input field by adding a name attribute to each element.</p><p>When you initialize the state in the constructor, use the field names.</p><p>To access the fields in the event handler use the event.target.name and event.target.value syntax.</p><p>To update the state in the this.setState method, use square brackets [bracket notation] around the property name.</p><p>Example: Write a form with two input fields</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*cfxc21WjvSgCIcF_7SsVdQ.png" /><figcaption>When you need to handle multiple controlled input elements, you can add a name attribute to each element and let the handler function choose what to do based on the value of event.target.name.</figcaption></figure><h3>The textarea Tag</h3><p>The textarea element in React is slightly different from ordinary HTML.</p><p>In HTML the value of a textarea was the text between the start tag &lt;textarea&gt; and the end tag &lt;/textarea&gt;, in React the value of a textarea is placed in a value attribute:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*_8_tmdnG6oTOsSFFX0EQHg.png" /></figure><h3>The select Tag</h3><p>In HTML, &lt;select&gt; creates a drop-down list. For example, this HTML creates a drop-down list of flavors.</p><p>React, instead of using this selected attribute, uses a value attribute on the root select tag. This is more convenient in a controlled component because you only need to update it in one place.</p><p>Example: A simple select box, where the selected value “Volvo” is initialized in the constructor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*P27_I6Z8sTv5xH1qZxen1Q.png" /></figure><h3>Submitting Forms</h3><p>You can control the submit action by adding an event handler in the onSubmit attribute.</p><p>Example: Add a submit button and an event handler in the onSubmit attribut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*03H8618dKiKfogO9KndKTA.png" /><figcaption>Note that we use event.preventDefault() to prevent the form from actually being submitted.</figcaption></figure><h3>Conclusion</h3><p>It can sometimes be tedious to use controlled components, because you need to write an event handler for every way your data can change and pipe all of the input state through a React component. This can become particularly annoying when you are converting a preexisting codebase to React, or integrating a React application with a non-React library. In these situations, you might want to check out <a href="https://reactjs.org/docs/uncontrolled-components.html">uncontrolled components</a>, an alternative technique for implementing input forms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c595af5c091" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React State]]></title>
            <link>https://sekou-dosso82-17502.medium.com/react-state-43c8c40325ef?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c8c40325ef</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 12:47:30 GMT</pubDate>
            <atom:updated>2020-09-28T12:47:30.203Z</atom:updated>
            <content:encoded><![CDATA[<p>React components has a built-in state object.</p><p>The state object is where you store property values that belongs to the component.</p><p>When the state object changes, the component re-renders.</p><h4>Creating the state Object</h4><p>The state object is initialized in the constructor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*6VKvGzrC2yKH9RvWtfOeoQ.png" /></figure><h4>Example:</h4><p>Specify the state object in the constructor method:</p><p>The state object can contain as many properties as you like:</p><h4>Example:</h4><p>Specify all the properties your component need:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*hKSptgyjlE6LKQ1pQ2PjBg.png" /></figure><h4>Using the state Object</h4><p>Refer to the state object anywhere in the component by using the this.state.<em>propertyname</em> syntax:</p><h4>Example:</h4><p>Refer to the state object in the render() method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*A12cT_aGqar_8YOD4lzfVA.png" /></figure><h4>Changing the state Object</h4><p>When you call setState(), React merges the object you provide into the current state.</p><p>To change a value in the state object, use the this.setState() method.</p><p>When a value in the state object changes, the component will re-render, meaning that the output will change according to the new value(s).</p><h4>Example:</h4><p>Add a button with an onClick event that will change the color property:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*DSZkWW5tqYXFaZrzRHcDqA.png" /></figure><p>Always use the setState() method to change the state object, it will ensure that the component knows its been updated and calls the render() method (and all the other lifecycle methods).</p><h4>The Data Flows Down</h4><p>Neither parent nor child components can know if a certain component is stateful or stateless, and they shouldn’t care whether it is defined as a function or a class.</p><p>This is why state is often called local or encapsulated. It is not accessible to any component other than the one that owns and sets it.</p><p>A component may choose to pass its state down as props to its child components:</p><p>This is commonly called a “top-down” or “unidirectional” data flow. Any state is always owned by some specific component, and any data or UI derived from that state can only affect components “below” them in the tree.</p><p>In React apps, whether a component is stateful or stateless is considered an implementation detail of the component that may change over time. You can use stateless components inside stateful components, and vice versa.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c8c40325ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Events]]></title>
            <link>https://sekou-dosso82-17502.medium.com/react-events-3ae0f9476ad2?source=rss-c2305751345------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ae0f9476ad2</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Sekou Dosso]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 13:07:16 GMT</pubDate>
            <atom:updated>2020-09-21T13:07:16.906Z</atom:updated>
            <content:encoded><![CDATA[<p>React is a JavaScript library for building user interfaces. React is used to build single page applications. React allows us to create reusable UI components.</p><p>Just like HTML, React can perform actions based on user events.</p><p>React has the same events as HTML: click, change, mouseover etc.</p><h3>Adding Events</h3><p>Handling events with React elements is very similar to handling events on DOM elements. There are some syntax differences:</p><ul><li>React events are named using camelCase, rather than lowercase.</li><li>With JSX you pass a function as the event handler, rather than a string.</li></ul><p>onClick instead of onclick.</p><p>React event handlers are written inside curly braces:</p><p>onClick={shoot} instead of onClick=&quot;shoot()&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*yrm8B752Gjbz5iIcIyZhaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*W_j834SFN2pHhbgXfFwj_Q.png" /></figure><h3>Event Handlers</h3><p>A good practice is to put the event handler as a method in the component class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*ane_vp6fV3Wt8ECONf5QJA.png" /></figure><p>Another difference is that you cannot return false to prevent default behavior in React. You must call preventDefault explicitly. For example, with plain HTML, to prevent the default link behavior of opening a new page, you can write:</p><p>HTML</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*_Quq5BLeQvPRND9foX47HA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*Qo5EZxTmISQx0qIpXNbSaA.png" /></figure><h3>Bind this</h3><p>For methods in React, the this keyword should represent the component that owns the method.</p><p>That is why you should use arrow functions. With arrow functions, this will always represent the object that defined the arrow function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*MTyNcSqegJwnQEfmFhbcrQ.png" /></figure><h3>Why Arrow Functions?</h3><p>In class components, the this keyword is not defined by default, so with regular functions the this keyword represents the object that called the method, which can be the global window object, a HTML button, or whatever.</p><p>If you must use regular functions instead of arrow functions you have to bind this to the component instance using the bind() method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*o-q5ZP1zLRFQC6qvy2Uu0A.png" /></figure><p>You have to be careful about the meaning of this in JSX callbacks. In JavaScript, class methods are not <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind">bound</a> by default. If you forget to bind this.handleClick and pass it to onClick, this will be undefined when the function is actually called.</p><p>This is not React-specific behavior; it is a part of <a href="https://www.smashingmagazine.com/2014/01/understanding-javascript-function-prototype-bind/">how functions work in JavaScript</a>. Generally, if you refer to a method without () after it, such as onClick={this.handleClick}, you should bind that method.</p><p>If calling bind annoys you, there are two ways you can get around this. If you are using the experimental <a href="https://babeljs.io/docs/plugins/transform-class-properties/">public class fields syntax</a>, you can use class fields to correctly bind callbacks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*ProyV_h-DY0HTSnGOglzRQ.png" /></figure><p>This syntax is enabled by default in <a href="https://github.com/facebookincubator/create-react-app">Create React App</a>.</p><p>If you aren’t using class fields syntax, you can use an <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions">arrow function</a> in the callback:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*cdH1YBYwYL8FrWXBz93pQQ.png" /></figure><p>The problem with this syntax is that a different callback is created each time the LoggingButton renders. In most cases, this is fine. However, if this callback is passed as a prop to lower components, those components might do an extra re-rendering. We generally recommend binding in the constructor or using the class fields syntax, to avoid this sort of performance problem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ae0f9476ad2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>