Skip to content

Instantly share code, notes, and snippets.

@caryamiel
caryamiel / gist:5226141651044ad9c24a
Last active January 8, 2016 12:34
RUBY ON RAILS: how to filter index action to send json file with an user_id:value equal to localhost:user/:ID/projects NEED HELP
class ProjectsController < ApplicationController
before_action :set_project, only: [:show, :edit, :update, :destroy]
skip_before_filter :verify_authenticity_token
before_action :set_user, only: [:show, :edit,:create, :update, :destroy]
# GET /projects
# GET /projects.json
def index
@projects = Project.all
render json: @projects
num = 0
while num < 1000
puts num +=2
end