You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default this engine save all request made on your short url, you can use that data for some analitics or simple ip logger. So for get the data in a controller or do wherever you want you can use the Visit model related to a Url:
33
35
```ruby
34
36
RailsUrlShortener::Url.find_by_key("key").visits # all visits
35
-
RailsUrlShortener::Url.find_by_key("key").visits.browser(:firefox) # only where user_agent indicate a firefox browser
36
37
37
38
```
38
39
Or using the model class:
@@ -55,27 +56,37 @@ gem "rails_url_shortener"
55
56
56
57
Or install it yourself as:
57
58
```bash
58
-
$ gem install rails_url_shortener
59
+
gem install rails_url_shortener
59
60
```
60
61
61
62
Then execute:
62
63
```bash
63
-
$ bundle
64
+
bundle
64
65
```
65
66
66
67
And finally install the migrations on your project and migrate:
If you want the initializer for configurations do:
72
73
73
74
```bash
74
-
$ rails generate RailsUrlShortener:initializer
75
+
rails generate RailsUrlShortener:initializer
75
76
```
76
77
77
78
## Contributing
78
-
Contribution directions go here.
79
+
80
+
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
81
+
82
+
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
83
+
Don't forget to give the project a star! Thanks again!
84
+
85
+
1. Fork the Project
86
+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
87
+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
88
+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
89
+
5. Open a Pull Request
79
90
80
91
## License
81
92
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
0 commit comments