Ask A Question

Notifications

You’re not receiving notifications from this thread.

Advanced Messaging with Mailboxer: Adding Attachments Discussion

Perfect! Thanks!

Reply

How does one go about adding multiple attachments?

Reply

How to do this with Refile gem?

Reply

Thanks for the video. However I am trying to upload a file on the new conversations and it doesn't work. it works though on the reply when the conversion already exists.

<div class="row">
<div class="col-md-12">

<h1>New Conversation </h1>

<%= form_for @message, url: conversations_path do |f| %>

<div class="form-group">
<div class="col-md-8">
<% if current_user.admin? %>
<%= select_tag :user_ids, options_from_collection_for_select(@recipients, :id, :name),
multiple: true, class: 'form-control' %>
<% else %>
<%= select_tag :user_ids, options_from_collection_for_select(@recipients, :id, :name), class: 'form-control' %>
<% end %>
</div>
</div>

<div class="form-group">
<div class="col-md-8">
<%= f.text_field :subject, placeholder: "Subject", class: 'form-control' %>
</div>
</div>

<div class="form-group">
<div class="col-md-8">
<%= f.text_area :body, placeholder: "Your message goes here",
class: 'form-control' %>
</div>
</div>




<hr/>

<div class="form-group">
<div class="col-md-8">
<%= f.file_field :attachment %>
</div>
</div>




<hr/>

<div class="form-group">
<div class="col-md-8">
<%= f.submit "Send", class: 'btn btn-primary btn-lg' %>
</div>
</div>

<% end %>

</div>
</div>

It shows the following error

No route matches {:action=>"show", :controller=>"conversations", :id=>nil} missing required keys: [:id]

I tried replacing select_tag with f.select and its still doesn't work.

What could I be doing wrong?

Kind Regards,
Joseph

Reply

One question this is for messages between users in application or is to make a imap client ?

Reply

Great stuff. Thank you again!

Question: if someone does end up refactoring or updating the gem, does that mean that suddenly our mailbox uploading feature will cease to function? Or would that only be an issue if we updated to a revised version of the gem without making the required new changes to the code?

Reply

I love the insight that an out-of-date gem can be an opportunity to learn how to level up your skills. BTW, here's an update about mailboxer: someone has forked and has answered some of the pull requests.

If you want a more updated version of mailboxer, check this out: https://github.com/chriscz/mailboxer/issues/1

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.