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

Fix generation of Haml #58

Open
willtcarey opened this issue Sep 27, 2022 · 1 comment
Open

Fix generation of Haml #58

willtcarey opened this issue Sep 27, 2022 · 1 comment

Comments

@willtcarey
Copy link
Member

@mwilkins74 had an issue generating his haml files. The Haml gem was asking to install html2haml, but after installing that things were still erroring. Let's figure out what's going on here.

@hannahekehoe
Copy link

I didn't have any errors with bundling the haml gem or converting my files, but the code in the book will need updating since generated template views have changed. For example in app/views/books/index.html.haml:

Book version

%p#notice= notice
%h1 Books
%table
  %thead
    %tr
      %th Title
      %th Description
      %th Price
      %th{:colspan => "3"}
  %tbody
    - @books.each do |book|
      %tr
        %td= book.title
        %td= book.description
        %td= book.price
        %td= link_to 'Show', book
        %td= link_to 'Edit', edit_book_path(book)
        %td= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' }
%br/
= link_to 'New Book', new_book_path

New code

%p{:style => "color: green"}= notice
%h1 Books
#books
  - @books.each do |book|
    = render book
    %p
      = link_to "Show this book", book
= link_to "New book", new_book_path

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

No branches or pull requests

2 participants