# Action response format

**URL:** <https://discourse.hanakai.org/t/action-response-format/268>\
**Category:** questions\
**Created:** [July 28, 2016, 6:24am UTC](https://discourse.hanakai.org/t/action-response-format/268 "2016-07-28T06:24:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladra](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/vladra/32/232_2.png) [@vladra](https://discourse.hanakai.org/u/vladra)\
**Post date:** [July 28, 2016, 6:24am UTC](https://discourse.hanakai.org/t/action-response-format/268/1 "2016-07-28T06:24:07Z")

</div>

I have an action which should return JSON request.

I’ve added `accept :json` to my action, and `format :json` to my corresponding view.

But during json request, hanami fails with error because of no view found.

After I specified format inside `call` method of the action, it started working:

```
def call(params)
  self.format = :json
end

```

So I was wondering if it is correct behaviour and why do I need to specify `accept :json` in this case?
