6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/cadinsor/api_keys_controller.rb', line 6
def create
@key = ApiKey.new
@key.client_app_id = params[Cadinsor::Engine.config.api_key_param_name].to_i if params[Cadinsor::Engine.config.api_key_param_name]
@key.generate_key!
if @key.save
respond_to do |format|
format.json {redirect_to :action => 'show', :format => 'json', :key => @key.key}
format.xml {redirect_to :action => 'show', :format => 'xml', :key => @key.key}
end
else
respond_to do |format|
format.json
format.xml
end
end
end
|