开发者

redirection from one controller to another in rhodes mobile application frame work using ruby

i like share this to programmers who are new in rhodes frame work. I got one problem in redirecting from one controller to another. First time i tried below code.

redirect_to :controller => :User, :action=>:new

But wasn't working for me. I got below soln for that and it works fine.

url_for :con开发者_高级运维troller => :User, :action=>:new

Thanks, Dileep Paul


In Rhodes, the proper syntax is redirect, not redirect_to. (reference: http://docs.rhomobile.com/rhodes/rhom#associations)

You also do not need to utilize the url_for construct.

def create
     @product = Product.new(@params['product'])
     @product.save

     redirect :controller => :Customer, :action => :index
end
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜