havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.3, 3.0.5, 2.7.7, 3.2.0-rc1: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://libera.irclog.whitequark.org/ruby/
caedmon has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.7.1]
crax23 has joined #ruby
crax23 has quit [Remote host closed the connection]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 272 seconds]
caedmon has quit [Ping timeout: 268 seconds]
FullMetalStacker has joined #ruby
FullMetalStacker has quit [Client Quit]
cartdrige has joined #ruby
crax23 has quit [Ping timeout: 260 seconds]
caedmon has joined #ruby
caedmon has quit [Client Quit]
caedmon has joined #ruby
crankharder has joined #ruby
caedmon has quit [Ping timeout: 252 seconds]
crankharder has quit [Ping timeout: 272 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 268 seconds]
cartdrige has joined #ruby
Y05hito__ has joined #ruby
crax23 has quit [Ping timeout: 272 seconds]
Rounin has quit [Ping timeout: 260 seconds]
cartdrige has quit [Ping timeout: 272 seconds]
caedmon has joined #ruby
Y05hito__ has quit [Ping timeout: 272 seconds]
ur5us__ has quit [Quit: Leaving]
caedmon has quit [Read error: Connection reset by peer]
caedmon has joined #ruby
ur5us has joined #ruby
ur5us has quit [Client Quit]
ur5us has joined #ruby
crankharder has joined #ruby
cartdrige has joined #ruby
FullMetalStacker has joined #ruby
FullMetalStacker has quit [Client Quit]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 272 seconds]
Y05hito__ has joined #ruby
crax23 has quit [Ping timeout: 252 seconds]
Y05hito__ has quit [Ping timeout: 272 seconds]
cartdrige has joined #ruby
cartdrige has quit [Read error: Connection reset by peer]
cartdrige has joined #ruby
crankharder has quit [Ping timeout: 272 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 252 seconds]
work has joined #ruby
teclator has joined #ruby
caedmon has quit [Ping timeout: 268 seconds]
crankharder has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
oxfuxxx has joined #ruby
crax23 has quit [Ping timeout: 272 seconds]
oxfuxxx has quit [Ping timeout: 260 seconds]
cartdrige has joined #ruby
sagax has joined #ruby
ur5us has joined #ruby
jhass has quit [Ping timeout: 252 seconds]
jhass has joined #ruby
crankharder has quit [Ping timeout: 272 seconds]
ur5us has quit [Ping timeout: 256 seconds]
stirl has joined #ruby
cartdrige has quit [Ping timeout: 268 seconds]
Linux_Kerio has joined #ruby
CrazyEddy has quit [Ping timeout: 252 seconds]
yCrazyEdd has joined #ruby
crankharder has joined #ruby
work has quit [Quit: Connection closed for inactivity]
crankharder has quit [Ping timeout: 272 seconds]
cartdrige has joined #ruby
yCrazyEdd is now known as CrazyEddy
ur5us has joined #ruby
cartdrige has quit [Quit: I am more peaced off than a dragon trying to blow out candles]
moldorcoder7 has quit [Ping timeout: 252 seconds]
ur5us has quit [Quit: Leaving]
cartdrige has joined #ruby
molle has joined #ruby
crankharder has joined #ruby
mollerup has quit [Read error: Connection reset by peer]
crankharder has quit [Ping timeout: 272 seconds]
crax23 has joined #ruby
Y05hito__ has joined #ruby
cartdrige has quit [Ping timeout: 260 seconds]
Y05hito__ has quit [Client Quit]
crax23 has quit [Ping timeout: 264 seconds]
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
willfish has joined #ruby
hansolo has quit [Ping timeout: 260 seconds]
otisolsen70 has joined #ruby
otisolsen70 has quit [Remote host closed the connection]
otisolsen70 has joined #ruby
crankharder has joined #ruby
hansolo has joined #ruby
crankharder has quit [Ping timeout: 248 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
stirl has quit [Ping timeout: 272 seconds]
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
reset has quit [Quit: reset]
<cxl> Hi all, with this controller and view: https://gist.github.com/coaxial/7f1a49ceb99578454239b55fa0fa245c, errors never show. once in the view, @errors is always nil even if it wasn't in the controller (checked with a breakpoint before the redirect). What am I doing wrong?
Tempesta has quit [Quit: See ya!]
Tempesta has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 272 seconds]
<ox1eef_> The redirect won't persist @errors to the next action.
<ox1eef_> You might have to store them in 'flash'.
<ox1eef_> cxl: ^
M1ll173r47[m]1 has quit [Ping timeout: 260 seconds]
andrea[m] has quit [Ping timeout: 260 seconds]
Bigou[m] has quit [Ping timeout: 252 seconds]
Cata[m]1 has quit [Ping timeout: 265 seconds]
flan[m] has quit [Ping timeout: 246 seconds]
tiziodcaio has quit [Ping timeout: 260 seconds]
jhass[m] has quit [Ping timeout: 260 seconds]
zaben[m]1 has quit [Ping timeout: 256 seconds]
Alhamdulillah[m] has quit [Ping timeout: 246 seconds]
M1ll173r47[m]1 has joined #ruby
tiziodcaio has joined #ruby
Bigou[m] has joined #ruby
andrea[m] has joined #ruby
Cata[m]1 has joined #ruby
flan[m] has joined #ruby
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp has joined #ruby
jhass[m] has joined #ruby
zaben[m]1 has joined #ruby
Alhamdulillah[m] has joined #ruby
<cxl> ox1eef_: I see, thanks. I'm trying to use a separate controller for my form, as users can upload several files at once but they should result in one model per file. Is there a reference somewhere for this pattern? I got it kinda working but it's hacky and I'm not super happy with it.
crankharder has joined #ruby
<ox1eef_> cxl: Then you probably want to open a transaction, and make it an all or nothing operation. You could also only redirect on success, and otherwise re-render the form (with '@errors' in scope).
Jonopoly has joined #ruby
<ox1eef_> I suggest that you create a class method on your model that accepts an array of files. This method should open a transaction (eg: transaction { .. }), and when you save each model, use save! - as that will raise an exception on error, and cause a DB rollback.
<ox1eef_> You might have to adapt the situation a bit so that you can report back errors, and I guess you would want errors for each file, so in that case you should probably collect errors for each model, and at the very end raise to cause a rollback for any records that did save.
crankharder has quit [Ping timeout: 272 seconds]
moldorcoder7 has joined #ruby
crankharder has joined #ruby
caedmon has joined #ruby
crankharder has quit [Client Quit]
cartdrige has joined #ruby
caedmon has quit [Ping timeout: 272 seconds]
caedmon has joined #ruby
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 246 seconds]
cartdrige has joined #ruby
crax23 has quit [Ping timeout: 264 seconds]
cartdrige has quit [Read error: Connection reset by peer]
cartdrige has joined #ruby
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 272 seconds]
crax23 has quit [Client Quit]
Starfoxxes has quit [Ping timeout: 265 seconds]
Starfoxxes has joined #ruby
graywolf has joined #ruby
willfish has quit [Quit: WeeChat 3.7.1]
polishdub has joined #ruby
graywolf has quit [Quit: WeeChat 3.5]
Jonopoly has quit [Quit: WeeChat 3.0]
sylario has joined #ruby
stirl has joined #ruby
joto has joined #ruby
desnudopenguino has quit [Ping timeout: 246 seconds]
Al2O3 has quit [Ping timeout: 255 seconds]
desnudopenguino has joined #ruby
Al2O3 has joined #ruby
jidar has joined #ruby
reset has joined #ruby
r3m has quit [Quit: WeeChat 3.8-dev]
r3m has joined #ruby
_ht has joined #ruby
stirl has quit [Ping timeout: 260 seconds]
r3m has quit [Quit: WeeChat 3.8-dev]
r3m has joined #ruby
ur5us has joined #ruby
desnudopenguino has quit [Ping timeout: 256 seconds]
_ht has quit [Remote host closed the connection]
c10l has quit [Quit: See ya! o/]
c10l has joined #ruby
c10l has quit [Client Quit]
c10l has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
otisolsen70 has quit [Quit: Leaving]
stirl has joined #ruby
perrierjouet has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
tomtmym has quit [Quit: Gone.]
marcotc has joined #ruby
marcotc has quit [Quit: Client closed]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Pixi has quit [Ping timeout: 272 seconds]
Pixi has joined #ruby
moldorcoder7 has quit [Ping timeout: 272 seconds]
desnudopenguino has joined #ruby
Linux_Kerio has quit [Ping timeout: 268 seconds]