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

Adds doc for ActionView::UrlHelper module #37113

Closed
wants to merge 1 commit into from
Closed

Adds doc for ActionView::UrlHelper module #37113

wants to merge 1 commit into from

Conversation

shivabhusal
Copy link
Contributor

Summary

I found no doc for methods like link_to, url_for, sms_to, phone_to, mail_to, link_to_if, etc in guides.rubyonrails.org

@rails-bot rails-bot bot added the docs label Sep 3, 2019
@shivabhusal shivabhusal closed this Sep 3, 2019
@shivabhusal shivabhusal reopened this Sep 3, 2019
@shivabhusal

This comment has been minimized.

Copy link

@knibesh knibesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am sure it will help beginners to understand Action View's UrlHelper module.

Copy link

@Shristinaaa Shristinaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very helpful addition.

@suman-tiwari
Copy link

Thanks for the addition. Its a good documentation with clear concept illustration.

Copy link

@romankhadka romankhadka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detailed docs with lots of examples. Very Helpful

@shivabhusal
Copy link
Contributor Author

shivabhusal commented Sep 12, 2019

@kamipo, @eugeneius please review

.gitignore Outdated
@@ -17,3 +17,4 @@ pkg/
/tmp/
/yarn-error.log
/test-reports/
.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is specific to your environment. Would you mind removing this and using a global gitignore for these kinds of files?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i will remove

guides/source/action_view_overview.md Show resolved Hide resolved
Provides a set of methods for making links and getting URLs that
depend on the routing subsystem (see ActionDispatch::Routing).
This allows you to use the same format for links in views
and controllers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Provides methods for making links and getting URLs that depend on Rails' routing subsystem. is concise enough.

```
See [API Doc for more info](https://api.rubyonrails.org/v6.0/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to)

#### link_to_unless_current
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary to document here. Please remove this line to the end of phone_to.

and controllers.

#### url_for
Resides in `ActionView::RoutingUrlFor` module.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Returns a URL given a set of `options`. with one example is good enough.

url_for(action: 'login', controller: 'members', protocol: 'https')
# => https://www.example.com/members/login


```
#### link_to
Creates an anchor element of the given `name` using a URL created by the set of `options`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Creates an anchor element of the given `name` using a URL created by the set of `options`. again with one example is preferred here.

link_to "Profile", profile_path(@profile)
# => <a href="/profiles/1">Profile</a>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmcgibbon since link_to is highly useful so lets have 2 examples for it. I have reduced desc.

guides/source/action_view_overview.md Show resolved Hide resolved
@rails-bot rails-bot bot added the railties label Oct 1, 2019
@kaspth kaspth closed this in 8837d15 Oct 6, 2019
@kaspth
Copy link
Contributor

kaspth commented Oct 7, 2019

Thanks @shivabhusal, I've applied some smaller edits and merged. 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants