2

Have:

def render
  begin
    array= [:orange => 1,:limon => 3]
  rescue Exception => e
    puts e
  end
end

how to return a array in one json

1
  • What alternatives did you check? Commented Jan 12, 2015 at 23:45

1 Answer 1

3
def render
  begin
     array= [:orange => 1,:limon => 3]
     render :json => {:array => array},:callback => params[:callback]
  rescue Exception => e
     puts e
  end
end
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.