Giter Site home page Giter Site logo

website's Introduction

The Ruby on Rails Website

This repository generates what goes on the https://rubyonrails.org website.

Contributions

If you notice spelling mistakes, or the latest version marker being out of sync, please do submit a pull request.

We do not, however, take pull requests for updating the list of highlighted Rails applications.

Development

  1. bundle install
  2. bundle exec jekyll serve --livereload
  3. Go to http://localhost:4000/

website's People

Contributors

amandaperino avatar ayushn21 avatar carlosantoniodasilva avatar dhh avatar eileencodes avatar ellaherlihy avatar fxn avatar geraldspreer avatar gregmolnar avatar huiclaire avatar jhawthorn avatar john-farina avatar jonathanhefner avatar kaspth avatar koic avatar morgoth avatar msinta avatar p8 avatar pixeltrix avatar rafaelfranca avatar robin850 avatar seanmitchell avatar siaw23 avatar stevecondylios avatar tenderlove avatar vipulnsward avatar weepotty avatar whatnotery avatar wildjcrt avatar zzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

website's Issues

Add license

Can you please add licenses for the source code, and the blog posts in this repository.

Disallow mass assignment in Action Controller example?

Congrats on the release of rails 7! And the new site (it's brilliant).

In the Action Controller example, I wondered if permit should be preferred over permit!?

Current:

def article_params
  params.require(:article).permit!(:title, :content)
end

Suggestion:

def article_params
  params.require(:article).permit(:title, :content)
end

I guess permit! was used to demonstrate mass assignment functionality (or perhaps the example application needed it to be that way). Just wanted to check, as permit seems a little more common and possibly safer for demonstration purposes.

After opening some links, enter a dead loop

http://localhost:4000/category/news/
http://localhost:4000/community/

<html>
<body>
<!--StartFragment-->
  | <!DOCTYPE html>
-- | --
  | <html lang="en-US">
  | 
  | <title>Redirecting&hellip;</title>
  | <link rel="canonical" href="http://localhost:4000/category/news">
  | <script>location="http://localhost:4000/category/news"</script>
  | <meta http-equiv="refresh" content="0; url=http://localhost:4000/category/news">
  | <meta name="robots" content="noindex">
  | <h1>Redirecting&hellip;</h1>
  | <a href="http://localhost:4000/category/news">Click here if you are not redirected.</a>
  | </html>
  |  

<!--EndFragment-->
</body>
</html>

<html>
<body>
<!--StartFragment-->
  | <!DOCTYPE html>
-- | --
  | <html lang="en-US">
  | 
  | <title>Redirecting&hellip;</title>
  | <link rel="canonical" href="http://localhost:4000/community">
  | <script>location="http://localhost:4000/community"</script>
  | <meta http-equiv="refresh" content="0; url=http://localhost:4000/community">
  | <meta name="robots" content="noindex">
  | <h1>Redirecting&hellip;</h1>
  | <a href="http://localhost:4000/community">Click here if you are not redirected.</a>
  | </html>
  |  

<!--EndFragment-->
</body>
</html>

Suggestion to link to sponsors images

When you visit https://rubyonrails.org/world and scroll down, you'll see a list of sponsors. I think it'd be a nice touch to link the images somehow to the sponsors' sites. This will serve a few purposes:

  1. An easy way to visit the sponsor's site
  2. A way to find out what the sponsor does, for example. I don't know "The Agency" and can't find them on Google as there are quite a few "agencies".

@AmandaPerino

Screenshot 2023-08-05 at 13 16 27

Step 5.10 with rails 7.0.4.2 doesn't show error when failing to create article

Hi I'm not sure if this is the correct repo for this issue, but I was following the ruby on rails getting started guide at this URL and came upon a silent bug.

On Step 5.10 Adding Some Validation, there is a section where the user is asked to modify app/views/articles/new.html.erb to check for error messages:

The relevant code is:

<%= form_with scope: :article, url: articles_path, local: true do |form| %>
 
  <% if @article.errors.any? %>
    <div id="error_explanation">
      <h2>
        <%= pluralize(@article.errors.count, "error") %> prohibited
        this article from being saved:
      </h2>
      <ul>
        <% @article.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
 
  <p>
    <%= form.label :title %><br>
    <%= form.text_field :title %>
  </p>
 
  <p>
    <%= form.label :text %><br>
    <%= form.text_area :text %>
  </p>
 
  <p>
    <%= form.submit %>
  </p>
 
<% end %>
 
<%= link_to 'Back', articles_path %>

I got a silent error and did some Googling and found that in the terminal the form was being processed as TURBO_STREAM so I had to insert this snippet into the form line of code like so:

<%= form_with scope: :article, url: articles_path, local: true, data: { turbo: "false" } do |form| %>
...

to get the correct error as mentioned in the guide.

Sorry again if this is not the correct place to put this issue; I looked for the guides page in _pages but wasn't able to find it.

Some rubyonrails.org pages are not found when visit from search engine

ref: rails/rails#43912

Previously, https://rubyonrails.org serves pages with trailing slash but now it returns 404.
Existing links like search engines' indexes are still have references to old URL.
Is it intentional?

Steps to reproduce

  1. Search "rails security policy" on google.com
  2. Visit the Security policy page

image

Expected behavior

Show content as the same as https://rubyonrails.org/security or redirect to https://rubyonrails.org/security

Actual behavior

https://rubyonrails.org/security/ returns 404

Homepage Example Improvements

Hi! I'm quite a bit unfamiliar with the rails framework and was looking upon the homepage examples and have a few suggestions to maybe lessen some confusion (that at least I was encountering). Or moreover, it may be just that these examples are intended for those with Software Engineering backgrounds to see these and 'fill in the blanks' instead of a concrete example of how to accomplish the example outlined.

app/models/article.rb

  has_one_attached :avatar

One suggestion would be renaming this to :picture as I am believe it's meant to be a photo that is for the article, and not the avatar of the author.

app/views/articles/show.html.erb

<%= image_tag @article.creator.avatar.url %>

This is where my knowledge of the 'magic' of the framework becomes a bit limited, however should this line read as author instead of creator, or is there some internal mapping that assumes the belongs_to and maps creator as such for us?

app/views/articles/show.html.erb

<%= image_tag @article.creator.avatar.url %>
<%= @article.byline %>

Adding a sample of the byline method and showing its usage in the view might be helpful.

I would be more than happy to take this issue and create a PR with outlined fixes, I'm just wanting to make sure that my assumptions are correct and there is not framework 'magic' that is shown in these examples that I do not understand.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.