How to parse json accepted from android app in Rails -
how parse json data sent android app. suppoce have method in controller inside have parse json data.
suppoce android app able send json provided url. believe in order data android app have provide url android application.
the major question json stored, access via parameters hash?
try this
in controller create 1 method , call in before_action e.g.
before_action :parse_json_data_to_params def parse_json_data_to_params params.merge!(activesupport::json.decode(request.raw_post)) end
plese dont forget write except
block in front of bfore_action because raise error requests.
Comments
Post a Comment