Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Bahi Hussien
PLUS
Bahi Hussien
Courses Plus Student 13,128 Points

Rails Api No 'Access-Control-Allow-Origin'

Hi, I'm trying to access my TodoList Api from inside ionic app using Angularjs get request. i'm getting the following error on console

XMLHttpRequest cannot load https://yallaoman.herokuapp.com/posts.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. 

What is this error and how to fix it? please help.

//please note i have

skip_before_filter :verify_authenticity_token

on the top of my Api controller

// update: CURL commands works perfectly fine which makes me think that the Angular get request is the problem