Skip to content
Snippets Groups Projects
Commit af16aedc authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Wip #267

parent 0abe9d61
No related branches found
No related tags found
No related merge requests found
class Api::ApplicationController < ApplicationController
layout false
skip_before_action :authenticate_user!
def index
end
end
class Api::LheoController < Api::ApplicationController
def index
@programs = current_university.education_programs
end
end
<?xml version="1.0" encoding="utf-8"?>
<lheo xmlns="http://lheo.gouv.fr/2.3">
<offres>
<% @programs.each do |program| %>
<formation>
<intitule-formation><![CDATA[<%= program.name %>]]></intitule-formation>
</formation>
<% end %>
</offres>
</lheo>
......@@ -2,3 +2,4 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
Mime::Type.register "application/xml", :xml, %w( text/xml application/x-xml )
......@@ -30,6 +30,7 @@ Rails.application.routes.draw do
end
draw 'extranet'
draw 'api'
get '/media/:signed_id/:filename_with_transformations' => 'media#show', as: :medium
......
namespace :api do
get 'lheo' => 'lheo#index', defaults: { format: :xml }
root to: 'application#index'
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment