I’m getting errors when I try to start new conversations. Can you please help me figure out exactly why this is happening?
SyntaxError app/views/messages/new.html.erb:5: syntax error, unexpected keyword_class, expecting keyword_do or ‘{’ or ‘(’
‘.freeze;@output_buffer.safe_append=’
syntax error, unexpected tSTRING_BEG, expecting keyword_end
…=( label_tag ‘message[subject]’, ‘Subject’ );@output_buffer…
Started GET “/messages/new” for 127.0.0.1 at 2015-01-21 15:52:18 -0500
Processing by MessagesController#new as HTML
User Load (0.0ms) SELECT “users”.* FROM “users” WHERE “users”.“id” = ? ORDER BY “users”.“id” ASC LIMIT 1 [[“id”, 1]]
User Load (0.0ms) SELECT “users”.* FROM “users”
BizUser Load (1.0ms) SELECT “biz_users”.* FROM “biz_users”
Rendered messages/new.html.erb within layouts/application (10.0ms)
Completed 500 Internal Server Error in 50ms
ActionView::Template::Error (undefined method firstuser@hotmail.com_attacher' for nil:NilClass): 13: 14: <div class="form-group"> 15: <%= label_tag 'recipients', 'Choose recipients' %> 16: <%= select_tag 'recipients', recipients_options, multiple: true, class: 'form-control chosen-it' %> 17: </div> 18: 19: <%= submit_tag 'Send', class: 'btn btn-primary' %> app/helpers/messages_helper.rb:6:in
block in recipients_options’
I’m getting these errors inside of the messages\new.html.erb form
<h1>Start Conversation</h1>
<%= form_tag messages_path, method: :post do %>
<div class="form-group">
<%= label_tag 'message[subject]', 'Subject' %>
<%= text_field_tag 'message[subject]', nil, class: 'form-control', required: true %>
</div>
<div class="form-group">
<%= label_tag 'message[body]', 'Message' %>
<%= text_area_tag 'message[body]', nil, cols: 3, class: 'form-control', required: true %>
</div>
<div class="form-group">
<%= label_tag 'recipients', 'Choose recipients' %>
<%= select_tag 'recipients', recipients_options, multiple: true, class: 'form-control chosen-it' %>
</div>
<%= submit_tag 'Send', class: 'btn btn-primary' %>
<% end %>
def recipients_options
s = ''
users = User.all + BizUser.all; users.each do |user|
s << "<option value=' #{user.id}' data-img-src='#{attachment_url(@user, user.email, :profile_avatar, :fill, 30, 30)}'> #{user.username}</option>"
end
s.html_safe
end
I’m using refile gem btw for image attachments.