getting path via JSON and Rails