Answer the question
In order to leave comments, you need to log in
How to add different classes to blocks?
Hello!
Is it possible to make it so that in the final code, a certain class is added to the sender and receiver in order to style these blocks differently. Thank you.
.wrapper
.container
- if @over_ten
= link_to 'Show Previous', '?m=all'
.ui.segment
- @messages.each do |message|
- if message.body
- user = User.find(message.user_id)
.item
.content
.header
%strong= user.first_name
= message.message_time
.list
.item
%i.right.triangle.icon
= message.body
= form_for [@conversation, @message], html: {class: "ui reply form"} do |f|
.field
= f.text_area :body, class: "form-control"
= f.text_field :user_id, value: current_user.id, type: "hidden"
%div
= f.submit "Add Reply", class: "ui blue labeled submit icon button"
%div
= link_to "Delete conversation", conversation_path(@conversation), :method => :delete, :data => { :confirm => 'Are you sure?' }
Answer the question
In order to leave comments, you need to log in
specific class to sender and receiver
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question