Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

rails cors allow all

headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
headers['Access-Control-Request-Method'] = '*'
headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
Comment

rails cors allow all

config.middleware.insert_before 0, Rack::Cors do
      allow do
        origins '*'
        resource '*', :headers => :any, :methods => [:get, :post, :options]
      end
    end
Comment

rails cors allow all

gem 'rack-cors', :require => 'rack/cors'
Comment

PREVIOUS NEXT
Code Example
Ruby :: rust overwrite file 
Ruby :: what is ruby language used for 
Ruby :: droptable rails 
Ruby :: ruby hash loop 
Ruby :: font awesome icon rails submit button 
Ruby :: ruby print 
Ruby :: ruby conditionals 
Ruby :: validations rails integer suprior to 0 
Ruby :: ruby select certain keys from hash 
Ruby :: how to differentiate get and post when it has same name in rails 
Ruby :: call the api from ruby 
Ruby :: generate view rails 
Ruby :: ruby delete method 
Ruby :: ruby in array 
Ruby :: rails check if object is new 
Ruby :: ruby clear set 
Ruby :: sidekiq configuration file 
Ruby :: how to access function defined in model rails 
Ruby :: ruby ** 
Ruby :: rails add element to array 
Ruby :: ruby sinatra enable sessions 
Ruby :: ruby get haft of array 
Ruby :: ruby on rails project 
R :: Drop rows with missing values in R 
R :: reverse row order dataframe R 
R :: read csv online r 
R :: use summarize multiple columns r 
R :: correlation matrix in r 
R :: r ggplot stacked bar labels 
R :: what is a vector in r 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =