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
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very helpful addition.
Thanks for the addition. Its a good documentation with clear concept illustration. |
There was a problem hiding this 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
@kamipo, @eugeneius please review |
.gitignore
Outdated
@@ -17,3 +17,4 @@ pkg/ | |||
/tmp/ | |||
/yarn-error.log | |||
/test-reports/ | |||
.idea |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, i will remove
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.
Thanks @shivabhusal, I've applied some smaller edits and merged. 👏 |
Summary
I found no doc for methods like
link_to
,url_for
,sms_to
,phone_to
,mail_to
,link_to_if
, etc inguides.rubyonrails.org