New Rails Project for Fun
Today i push a new rails project to heroku called lunch. I also push to github. Every week day i and colleague have to discuss which lunch to eat. It will be very helpful if a site can random pick a lunch restaurant for us. So i create a new rails project for this purpose. The basic idea is simple, everybody can share a restaurant and add others’ restaurants to favorites list. Then site pick a restaurant for you. I can study new stuff when i practice rails each time. I try to write down here.
image store in S3
Because the heroku doesn’t allow to store images, i move the paperclip default storage to S3. It’s very easy to implement, just follow this tutorial
social network signin
This time i integrate three social networks(facebook, twitter, google).
I am stuck in google app setting for a while. Because they all have different callback url setting.
Finally i resolved and here are screenshots for these sites. These samples are for
I add a
app/presenters folder and make controller logic more impact.
Add folder path to
application.rb that controller could access them.
Google map support
Just create a user and call
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Use expect to assert result
restaurant is the return object from controller.
1 2 3
1 2 3 4 5 6 7 8 9 10 11 12