and only controller change require but i have no idea
my controller
def create
for i in count(params[:image])
puts i
end
exit @path =
File.join("#{RAILS_ROOT}/public/images/",params[:service][:image].original_filename)
File.open(@path, “wb”){|f| f.write(params[:service][:image].read)}
params[:service][“user_id”] = session[:user_id] @service = Service.new(params[:service])
@service.image=params[:service][:image].original_filename
respond_to do |format|
if @service.save
flash[:notice] = 'Service was successfully created.'
format.html { redirect_to(users_url) }
format.xml { render :xml => @service, :status => :created,
:location => @service }
else
format.html { render :action => “new” }
format.xml { render :xml => @service.errors, :status =>
:unprocessable_entity }
end
end
end
i got array like this
image0 => file1 with path
image1 => file1 with path
image2 => file2 with path
but i want store whole in image field separating comma
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.