Z
Z
Zaur Ashurbekov2014-04-24 22:27:47
Ruby on Rails
Zaur Ashurbekov, 2014-04-24 22:27:47

Why is the Html document not passed to the browser (slim, rails)?

Hello Habr!
After translating the page from erb to slim, it stopped sending code to the browser. The page is completely empty, not a line of code in the browser.
Can't figure out what I'm doing wrong?
file "new.html.slim"

- form_for @user, url: {action: "create"} do |f|
  table
    tr
      td = f.label :login
      td = f.text_field :login 
    tr
      td = f.label :email
      td = f.text_field :email
    tr
      td = f.label :password
      td = f.password_field :password
    tr
      td = f.label :password_confirmation
      td = f.password_field :password_confirmation
    tr
      td = f.submit :register

file "application.html.slim"
doctype html
html
  head
    title Gallery
    = stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true
    = javascript_include_tag "application", "data-turbolinks-track" => true  
    = csrf_meta_tags
  body
    = yield

here's what's in the logs:
Started GET "/users/new" for 127.0.0.1 at 2014-04-24 23:25:14 +0400
Processing by UsersController#new as HTML
  Rendered users/new.html.slim (2.4ms)
Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.0ms)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arkady Butermanov, 2014-04-24
@zaurius

Prefix form_for with = (equal) instead of - (dash). You simply execute the method and do not display the result of its work on the page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question