Secretprtay

styled_input

Feb 4th, 2022 (edited)
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 1.16 KB | None | 0 0
  1. # app/views/rooms/show.html.erb
  2.  
  3. <%= turbo_stream_from @room %>
  4. <%= turbo_stream_from [current_user, @room] %>
  5.  
  6. <div class="flex flex-col justify-between h-grow">
  7.   <div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8" id="chat-container">
  8.     <div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8" id="room_<%= @room.id %>_messages">
  9.       <%= render partial: "messages/message", collection: @messages, locals: { user: current_user } %>
  10.     </div>
  11.   </div>
  12.  
  13.   <%= form_with model: @new_message, data: { controller: "chat_refresh", action: "turbo:submit-end->chat_refresh#clearInput" } do |f| %>
  14.     <div class="rounded-md shadow-sm -space-y-px">
  15.       <%= f.text_field :body, autofocus: true, required: true, placeholder: "Your text", class: "appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm" %>
  16.       <%= f.hidden_field :room_id, value: @room.id %>
  17.   <% end %>
  18. </div>
  19.  
  20.  
  21. # app/assets/stylesheets/application.tailwind.css
  22. .h-grow {
  23.   height: calc(100vh - 13rem);
  24. }
  25.  
Add Comment
Please, Sign In to add comment