ALICHERIF / alpha-blog

rails app first

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version

  • System dependencies

  • Configuration

  • Database creation

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

  • ...

intersting for me you can assing article to user using shofle operator when we have artcile =('hh','eee') and user=("mohamed","adem") user.articles << article

show all articles

<% @articles.each do |article| %> <% end %>
title description action Actions
<%= article.title %> <%= article.description %> <%= link_to 'Show', article_path(article) %> <%= link_to 'edit', edit_article_path(article) %> <%= button_to 'Delete', article_path(article), method: :delete, onclick: "return confirm('Are you sure you want to delete this article?');" %>

<%= link_to 'new', new_article_path %>

<%= link_to 'Show', article_path(article) %> <%= link_to 'edit', edit_article_path(article) %> <%= link_to 'Delete', article_path(article), method: :delete, onclick: "return confirm('Are you sure you want to delete this article?');" %>

show article

Title:<%= @article.title %>

Description:<%= @article.description %>

<%= link_to 'edit', edit_article_path(@article) %> <%= button_to 'Delete', article_path(@article), method: :delete, onclick: "return confirm('Are you sure you want to delete this article?');" %> <%= link_to 'Return to articles listing', articles_path %>

Show article

  <div class="row justify-content-md-center " >
    <div class="col-8 mt-4" id="hmida">
      <div class="card-header font-italic">
      <%= @article.title %>
      </div>
  <div class="card-body shadow p-3 mb-5 bg-white rounded">

    <p class="card-text"><%= @article.description %></p>

    <a href="#" ><%= link_to 'edit', edit_article_path(@article),class: "btn btn-outline-info" %></a>
    <a href="#" ><%= link_to 'Delete', article_path(@article), method: :delete, onclick: "return confirm('Are you sure you want to delete this article?');",class: "btn btn-outline-danger"  %>
created <%= time_ago_in_words(@article.created_at)%> ago ,updated <%= time_ago_in_words(@article.updated_at) %> ago
user.toggle!(:admin)

About

rails app first


Languages

Language:Ruby 56.3%Language:HTML 37.1%Language:SCSS 4.2%Language:JavaScript 2.4%