But (there is always a but lol) i have a problem ! (2 in fact)
I'm using ruby 3.2.11
if I try to use in my routes.rb :
ruby
scope module: :v1, constraints:ApiConstraints.new(version:1) do
I have an error message 'No route matches [GET] "/dev/v1/media"', if I use a namespace instead (but without constraints) it works! Any idea ? (my first namespace is dev not api)
Other problem, I specified the json format by default in my namespace, set the respond_to :json in my controller but if I use respond_with, got a error message "Missing Template", I need to use :
ruby
@media = Medium.all
respond_to do |format|
format.json { render json:@media, status::created }
end
I use the gem s3_direct_upload inspirated by the code, but I have a problem.
Upload and progress bar works perfectly, my problem is :
The url of the uploaded file is a part a a Medium I create. The Medium contain "name", "description", "file_url" etc.
I don't display the S3 form at the creation of my medium, after saving, I redirect_to the Edit action and then display the S3 form to add a file. I tried to set post:media_url(@medium) or post:medium_edit_path(@medium) but it doesn't work cos I guess update require PUT and not POST.
So, is it possible to implement PUT with the gem or may I do something different ?
Just found a solution.
I need to do this
Hi,
Not work for me with rails 4 got a redirect loop :(
Any idea ?
I did it like this
confirm: t("sure")
but in fact my question is more for links like the one below :
It works like a charm :) Thank you very much !
Just a question, how can I use I18n in javascript confirmation, for example to delete an item
<%= link_to raw(''), user, confirm: 'Are you sure?', method: :delete %>
Thanks :)
Hi, nice episode, very helpful.
But (there is always a but lol) i have a problem ! (2 in fact)
I'm using ruby 3.2.11
if I try to use in my routes.rb :
I have an error message 'No route matches [GET] "/dev/v1/media"', if I use a namespace instead (but without constraints) it works! Any idea ? (my first namespace is dev not api)
Other problem, I specified the json format by default in my namespace, set the respond_to :json in my controller but if I use respond_with, got a error message "Missing Template", I need to use :
Any idea ?
Thanks :)
I use the gem s3_direct_upload inspirated by the code, but I have a problem.
Upload and progress bar works perfectly, my problem is :
The url of the uploaded file is a part a a Medium I create. The Medium contain "name", "description", "file_url" etc.
I don't display the S3 form at the creation of my medium, after saving, I redirect_to the Edit action and then display the S3 form to add a file. I tried to set post:media_url(@medium) or post:medium_edit_path(@medium) but it doesn't work cos I guess update require PUT and not POST.
So, is it possible to implement PUT with the gem or may I do something different ?
Thanks for your help
Ok adding group_ids as attr_accessible in my User Model solve the problem !
Sorry :p
Thanks for this great screencast.
Got an issue with my app.
Checkboxes well diplayed, but when I update, got a message "Can't mass-assign protected attributes: group_ids"
So, I try to manage membership.
Got users and groups.
membership model :
User model :
Group model
Here the code in my form
Did I miss something ?
Thanks
It seems the error is generated by the line has_secure_password
My Gemfile is OK, don't understand :(
Edit : Ok, it works, I installed brypt-ruby before, so I needed to update my bundle and restart my server !
Got this error on signup
undefined method
key?' for nil:NilClass`Any idea ?
Thanks