Skip to content

Commit ceaf3c9

Browse files
committed
docs: contributing section
1 parent 7e36de1 commit ceaf3c9

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# RailsUrlShortener (...in progress)
1+
# RailsUrlShortener
22

33
A small rails engine for short urls.
44
It could be used like a url shortener or a ip logger, it is your choice.
5-
The app generate a short url for you and then (if you want) receive the requests and redirect to the long url.
5+
The app generate a short url for you and then (if you want) receive the requests and redirect to the original url.
66

77
Why give your data to a third party app if you can do it by yourself?
88

@@ -11,7 +11,7 @@ Why give your data to a third party app if you can do it by yourself?
1111
Mount the controller on your app adding the next code on your config/routes.rb:
1212

1313
```ruby
14-
mount RailsUrlShortener::Engine, at: "/rus"
14+
mount RailsUrlShortener::Engine, at: "/"
1515

1616
```
1717

@@ -21,18 +21,19 @@ And generate the short links wherever you want using the helper method:
2121
short_url("https://www.github.com/a-chacon/rails_url_shortener")
2222
```
2323

24-
or model methods provided for this engine:
24+
or model method:
2525

2626
```ruby
2727
RailsUrlShortener::Url.generate("https://www.github.com/a-chacon/rails_url_shortener")
2828
```
2929

30+
**Then share the short link.**
31+
3032
### Deeper
3133

3234
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:
3335
```ruby
3436
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
3637

3738
```
3839
Or using the model class:
@@ -55,27 +56,37 @@ gem "rails_url_shortener"
5556

5657
Or install it yourself as:
5758
```bash
58-
$ gem install rails_url_shortener
59+
gem install rails_url_shortener
5960
```
6061

6162
Then execute:
6263
```bash
63-
$ bundle
64+
bundle
6465
```
6566

6667
And finally install the migrations on your project and migrate:
6768
```bash
68-
$ bin/rails rails_url_shortener:install:migrations db:migrate
69+
bin/rails rails_url_shortener:install:migrations db:migrate
6970
```
7071

7172
If you want the initializer for configurations do:
7273

7374
```bash
74-
$ rails generate RailsUrlShortener:initializer
75+
rails generate RailsUrlShortener:initializer
7576
```
7677

7778
## 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
7990

8091
## License
8192
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)