A Guide for Image Uploading (Paperclip, AWS, Heroku)

I've had some troubles integrating imageupload to work with heroku, that's why I wanted to share how I did it: First of all I asume the paperclip gem and imagemagick is installed. Secondly the model that is beeing used as the container for example a recipe box is configured like so: Since Heroku doesnt allow … Continue reading A Guide for Image Uploading (Paperclip, AWS, Heroku)

Advertisements

Raw SQL for search bar

I recently finished my project called: http://www.brau-brett.de I wasn't aware of the possibilities on how to create just a basic search function within my jobs database. I've found a neat little tutorial on how to do it without using any gem but raw sql. I started by impelmenting a searchfield into the index jobs index … Continue reading Raw SQL for search bar

Build a TDD RESTful JSON TODO-List API (pt.3)

Next on our list: controller. class TodosController < ApplicationController before_action :set_todo, only: [:show, :update, :destroy] # GET /todos def index @todos = Todo.all json_response(@todos) end # POST /todos def create @todo = Todo.create!(todo_params) json_response(@todo, :created) end # GET /todos/:id def show json_response(@todo) end # PUT /todos/:id def update @todo.update(todo_params) head :no_content end # DELETE /todos/:id … Continue reading Build a TDD RESTful JSON TODO-List API (pt.3)