开发者

index 49793 out of string

I have a strange problem, i can't even get the source of it.

I'm using ajax GET request to a specified url, that routes to :controller => pages, :action => make_affiche_link, there i have the following:

@album = Album.find( params[:album_id] )
@upd = { :affiche_id => params[:affiche_id] }

if @album.update_attributes( @upd )
  @out = {:key => '1', :message => "success"}
  render :json, @out.to_json
else
  @out = {:key => '0', :message => "something bad is going here..."}
  render :json =>开发者_如何学JAVA @out.to_json
end

and what i get is this:

index 49793 out of string

And i have both :affiche_id and :album_id in params properly

Thank you for any help!


It is Json @out = {:key => '1', :message => "success"}, you try convert Json to Json @out.to_json. Use render :json, @out

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜