
Fugee Ohu
Joined
Activity
Posted in How can I add to existing attachments
How do I add to existing attachments?
Is there a gem to manage image attachments in the view like craigslist and ebay that lets me add, remove, rearrange by dragging attachments without disturbing other attachments
Posted in How can I upload a file from the console
I'm trying to write a controller action that will create records with attachments from a form submission where the form has multiple true set for the file_field I wanna take the params from the form like caption and create a new record for each of the multiple files selected with the same caption but a different image so I'd be iterating through the selected files and creating a new record for each one I have to admit this may not be a good idea, it's a has_many_through setup allowing users to click on images to see records from associated tables It made sense for my old west site where pictures are significant but now I'm using the same code copied to on an e-commerce site I have to admit it's a pain but I wanna get a handle on it before migrating to a different approach so for the time being to help me write my controller action I wanna work out the core functions in console so my question is how do I upload a file from the console
Just upgraded my rails app to rails 6 so decided to switch to actiontext and looking for how to migrate my data from ckeditor to actiontext
How do I add a favicon in rails 6 through packs
app/javascripts/packs/application.js:
import "favicons"
app/javascripts/packs/favicons.js:
const faviconsContext = require.context(
‘!!file-loader?name=../images/favicons/[name].[ext]!.’,
true,
/.(svg|png|ico|xml|json)$/
);faviconsContext.keys().forEach(faviconsContext);
Posted in form using form_with not loading
127.0.0.1 - - [30/Nov/2019:19:55:21 EST] "GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=9&commit=New+item HTTP/1.1" 200 1758
http://localhost:3000/items -> /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=9&commit=New+item
<%= form_with(model: @item, url: new_item_path(@item), method: "get") do |f| %>
<div class="field">
<%= f.select :item_type_id, nested_set_options(ItemType.all, @item_type) {|i| "#{'-' * i.level} #{i.name}" }, {:include_blank => "Select"}%>
</div>
<div class="actions">
<%= f.submit "New item" %>
</div>
<% end %>