You are here: Forums Ask a Rails expert download a file when creating ...
Posted in Forums : Ask a Rails expert
Authority 0
Posting Rating 17
Sign in to rate this post
|
how can i use send_file helper in create method to saving record? |
Authority 62
Posting Rating 100
Sign in to rate this post
|
By using it! ;-) Sorry, but where is the problem? |
Authority 37
Posting Rating 78
Sign in to rate this post
|
Just to clarify Abolfazi. Are you trying to send a file back to the user after a record is created? Or are you trying to save a file to the server after a record is created? |
Authority 12
Posting Rating 76
Sign in to rate this post
|
you might want to send the file when you have created a record! for this after_create, after_save may be the relative things you want to use, but they are available in the model and you cant call the send_file from the model. So the easiest solution for this is: In some controller when you are creating the record @file = File.create( some parameters for the file ) if you have a sequence of steps to some where you can use a variable instead of @file which should decide either to send the file or not! Thanks |
Ask a Rails expert : Routing problem using patterns for id
Ask a Rails expert : How to work with ror 2.1.1 using Netbeans IDE 6.1
Ask a Rails expert : json gem error
Ask a Rails expert : Problem with break
Ask a Rails expert : activesupport string first method error
Ask a Rails expert : url_for broken ?
Ask a Rails expert : map.routes.rb pls help
Ask a Rails expert : how to h tag in controller
Ask a Rails expert : Problem with Restful routing and partial form
Ask a Rails expert : will_paginate, search and ajax