I am using wysihtml5 gem (https://github.com/stefanoverna/activeadmin-wysihtml5). It also uses activeadmin-dragonfly gem. Currently, it stores images under public folder. I am using rails 4. I need to know a way to change this path.
Related
How can I create a video and photo uploading feature on my website using Python and Django?
I have using forms,models(file_field) and yet it doesn't render to the front_end
If you're using ImageField to upload to the server, make sure you have pillow installed. Your python may just be looking at a wrong path to search for your files. Secondly, you might want to consider your markup code, and make sure that there is space for your video to be uploaded. ie) , etc..
I am using skydrive gem in my rails application . If there any function wherein I can find with all the folder names like in rails we have find_all_by.
I am following http://www.rubydoc.info/gems/skydrive/1.2.0/Skydrive link
There does not seem to by an implementation of a search / find method in the gem directly. But I believe you could add it yourself into it through the GET request with search parameter of the REST API of OneDrive (former SkyDrive) https://dev.onedrive.com/items/search.htm.
Am very new to magento, created one site using magento. All the functionality are working fine in localhost. When am upload that code into online(server), i got one issue. except that all functionality are working fine.
While am uploading an image i got the issue "Unable to create directory".
Images are uploading to tmp path but not moving to target path. Because when am press the button 'upload files', I can able to see the upload percentages. That is why am thing the files are not moving due to dynamic directory creation fails.
I have tried lot but i can't able to make it as work.
I had tried the following solution,
1. Changed the media file permission to 777.
2. Created one tmp directory under /var/ directory and assigned manually in as tmp directory by change the line 91 of lib/Zend/Cache/Backend/File.php ('cache_dir' => null to 'cache_dir' => 'var/tmp').
3. Changed the php.ini file under the magento root directory.
Newly added lines are,
magic_quotes_gpc = off
short_open_tag = on
extension=pdo.so
extension=pdo_mysql.so
4. Checked whether GD library installed or not. It was installed.
5. Changed scope attribute in Magento admin panel -> Catalog -> Attributes -> Manage attributes. After this you should find image, small_image & thumbnail attributes. Then am changed all these attributes scope to Global.
Many thanks in advance. Please share your thoughts. Feel free to post your comment also.
Finally I got solution at 22-Aug-2014.
Problem is PHP version issue, megento need php 5.2.13 but my server contains php 5.2.12
After updated php version, image upload working fine.
It appears that now in Rails 4 using asset pipeline and the sprocket-rails gem, when images are processed, their filename is appended with an md5 fingerprint like css and javascript. While this makes sense because md5 fingerprints are awesome, it makes it increasingly difficult to access that image from javascript. In rails 3.2, I could access the image with /assets/image_name.jpg and it would serve properly, but in rails 4 that asset doesn't exist, it only exists with the md5 fingerprint in the name.
I know that rails provides helpers to access the image via erb <%= asset-url("image_name.jpg") %> but that is less ideal in javascript, because I am not using erb in my js. There are plenty of ways I could hack this with data-attributes serving in the views or using a script tag in my view and setting some globals, but I am looking for a nice solution to this problem, if it exists.
Any help is appreciated, thanks.
Another option to consider (although I wouldn't recommend it) is to use a custom route in your application controller to grab the asset path for you in the controller and either return the url to the asset with the md5 hash or possibly just render the raw binary data of the asset (although this will add processing overhead to your application).
For example, you make a AJAX get request to
http://yourapp.com/images?file=my_image.jpg
Then in your controller your action method would look like this:
def images
ActionController::Base.helpers.asset_url(params[:file])
end
This would then return the url path to the asset. The downside to this method is that it requires that you make two requests on the JS side. The first to get the path to the asset and the second to actually load that asset with the returned path.
To reduce this down to one request you could have the application read the image from the file system and return the proper headers so the browser thinks it is an image being returned and therefor will render the url provided. However, this would be a lot more work for the application and a lot more unneeded disk IO on your server.
It may take two requests for each image on the client to achieve what you want but you have to sacrifice somewhere...
Why do you need to use the asset pipeline for images? I get the hashing behavior. But normally the assets would be preprocessed. If you put the images in the public hierarchy as in olden times, you would get normal path routing.
Here's a quote from the Asset Pipleline guide that I think might be germane.
"Assets can still be placed in the public hierarchy. Any assets under public will be served as static files by the application or web server. You should use app/assets for files that must undergo some pre-processing before they are served."
Unfortunately, I think that you are stuck either adding an ERB extension to your JS and using the asset helpers, or else not using the asset pipeline for the assets.
When you say "I am not using erb in my js", do you mean you don't want to, or simply that you aren't? Because you can!
If you rename the relevant JS files with the extension .js.erb then you can use the asset_url helper in these files like so:
var src = "<%= asset_url('photo.jpg') %>";
Due to the limitation of windows file path, Sitecore creates some random directory in the serialization folder for the sitecore content items.
This works well when we revert using the sitecore content editor, but not working while using Sitecore Rocks.
Sitecore rocks installs only the items in the correct path and skips the items in the random folders.
Any thoughts?
First, make sure you are running the latest version. If you are, then create a ticket at http://sitecorerocks.uservoice.com/