Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ('#') symbol when using html5mode in locationProvider #232

Closed
v3rtx opened this issue May 2, 2015 · 4 comments
Closed

Remove ('#') symbol when using html5mode in locationProvider #232

v3rtx opened this issue May 2, 2015 · 4 comments

Comments

@v3rtx
Copy link
Contributor

v3rtx commented May 2, 2015

I'm using html5 navigation in my angular app and I faced with the problem that I can't parse options passed by passwords_controller.
I've made local changed in my fork that checks params[:html5] and if it true removes '#' symbol form the url.

This changes also requires corresponding changes in the ng-token-auth module (which I also made locally and haven't forked and commited this changes).

I have a question if you are or anyone who use this gem is interested in such functionality (or maybe it was created already and I just don't see the obvious way to use html5 routing without any changes)?

I haven't tested my changes so I don't create a pull request, but if anyone interested in this functionality I will continue contribution procedure.

@aihaddad
Copy link

I am interested

@masanorinyo
Copy link

I am interested too!

@MichalZalecki
Copy link

+1

What I've made is:

#devise_token_auth_html5_mode.rb
DeviseTokenAuth::Concerns::User.class_eval do
  private

  def generate_url(url, params = {})
    uri = URI(url)

    res = "#{uri.scheme}://#{uri.host}"
    res += ":#{uri.port}" if (uri.port and uri.port != 80 and uri.port != 443)
    res += "#{uri.path}" if uri.path
    res += "?#{params.to_query}"
    res += "#{uri.fragment}" if uri.fragment

    return res
  end
end

@v3rtx
Copy link
Contributor Author

v3rtx commented Feb 8, 2016

Works on current version, so closing the issue.

@v3rtx v3rtx closed this as completed Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants