when I click in delete image this line fade n the view but don’t delete
this id of the database, so action destroy never call, why??? what
happen???
Please post your controller’s action code, too, and your test cases.
And shouldn’t :id => x be :id => x.id ?
that doesn’t matter. url_for special cases :id and tries to call
to_param on what you give it if it’s an AR object, and the default
definition of to_param is just id.
def destroy
empre=params[:id]
empre=empre.to_i
@todo=MercaUsuario.find(:all) @todo.each do |x|
if (x.user_id == current_user.id)&&(x.empresa== empre)
x.destroy
end
end
end
but link_to_remote no call function if I push debugger in this funcion
nothing happen
thaks again
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.