Monday, April 4, 2016

Week 12 - Wikipedia App - devise, haml, simple_form, bootstrap-sass



Today I finished Mackenzie Child's 12 Apps In 12 Weeks Challenge.  Below is the wikipedia app. You can create articles and put them into categories, which can be used to filter the articles.  I used simple_format again, which allows users to input html into the form for each article.

Show View


I saved this app for last only because I wanted to do the other 3 after this one first.  They were very different from the other apps.

Features to add:
1. Table of Contents
2. Embed pictures
3. Rendering an iframe so youtube links become embedded videos right on the view page.
4. Rich text formatting
5. Ability to upload text files

Technologies used: devisehamlsimple_formbootstrap-sass

So this concludes my 12 in 12 challenge.  I will make a post about my experience building all 12 apps in my next blog.

Kenyacode

Friday, April 1, 2016

Week 11 - Dribble App - carrierwave, acts_as_votable, fog-aws, mini_magick, devise, simple_form, haml




Today I finished work on the Dribble App.  It is a cool way to display artwork and anything visually stunning. (i.e. Wonder Woman)  Since it supports pictures and gifs, I had to again use paperclip, I mean carrierwave.  Paperclip didn't work for me for the 3rd time.  It works well locally but integration with S3 did not compute.

I learned some cool new things in this app.  Like in the picture below, on the right I can display a random post.  It was done with one simple line of code.






While working on a bug for a few hours I ran into a solution that wasn't covered by Mackenzie Child. When you push this app to heroku, you will not have a database.  There is code in post/show.html.haml that is looking to display a post that will break because there aren't any posts.

The code looks for a post that does not have the same user_id as the post that is displaying, puts it into a collection and gets a random one to display.  So I just thought, well it should only show a post if there is more than 1 post.


So in line 1 I added an if statement. if Post.count > 1 display the random post else display the sentence You have the first post.


It is not a big deal, since I can populate the database and it takes just one to keep the app from breaking, but in my book its a bug that had to be fixed.

Functionality I would like to add:
1. Better picture formatting so each pic on index page is the same size
2. Search function.
3. Rich text formatting
4. Social media shareability
5. Make pictures 30%-50% bigger. Move random box view down to lower right corner.
6. Add a large version of the picture to have as a background image for each post.
7. Tie dislike button to comments, so a user has to leave a comment if disliking a post.

Tune in next week, for the final app.

Kenyacode