Hartl Rails tutorial finished – adding new features for learning

Using the Hartl Rails tutorial I built the Twitter clone app and have been working through adding new features to get even closer to actual Twitter as exercises. I am currently trying to add a method for adding posts (tweets) using a modal window in addition to the field on the feed page. I have used the Bootstrap modal feature in success and can post new posts using the modal window, and this is the issue, IF i am on the feed page.

If i try to leave the feed page heroku says the page is not available. through some debugging I have found that it appears the issue is that any of the other pages, besides the home feed page, do not have permission to post new tweets. Therefore when the page tries to load the form it crashes do to permission limits. I figured this out by trying render the micropost form on the user page, with my modal window removed, and i could not load user pages.

My bitbucket for this app is posted [here](https://bitbucket.org/jwillet1/sample_app/src) and the modal code is in the _header partial. [This](https://cryptic-spire-8268.herokuapp.com/) is the working website if you would like to see it in action.

Thank you for your attention.

Hopefully this is clear and someone might be able to help me get this to work.

1 thought on “Hartl Rails tutorial finished – adding new features for learning”

  1. I believe it has to do with the fact that the instance variables required to make the feed work are only being initiated when the home feed page controller/ view is called.

    I’m thinking the form_for @micropost might be the culprit (perhaps due to strong parameters being private?). If you refactored and had all the micropost form behavior on a micro post view page, and then rendered the view in the header, this might help.

    Let me know if you figure it out. Turbo links is also known to interfere with JavaScript from time to time.

    Reply

Leave a Comment