On Thu, Oct 16, 2008 at 1:24 AM, daociyiyou <[EMAIL PROTECTED]> wrote:
>
> I have an ajax call method like following:
> ##############################
> def find_created_actions
>    unless @if_login
>      flash[:login]="请登录或注册"
>      redirect_to(:controller=>"login",:action=>"login")
>    end
>    if @if_login
>        @[EMAIL PROTECTED]
>        render :partial=>"created_actions",:object=>@user_cactions
>    end
>  end
> ###################################
> I hope when some condition met,the call will let some partial replace
> the html element's
> content,this works now.When the condition is not met,i hope redirect
> to another
> controller's action,not replace something.but in fact,that action's
> template replace
> the html element's content,this is not the result i want.How do i
> manage this?

Instead of redirect_to render a partial with a line of JS like this:

<script type="text/javascript">document.location="/login"</script>

HTH,
-- 
Hassan Schroeder ------------------------ [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to