last day (15 days later) » 

7:31 PM
Hello
 
hey bid
bud*
let's get this sorted
First thing you need to know - Devise has no bearing over your model functionality
 
thank you! I'll explain where I'm up to
 
devise is just a way for users to log in / register
that's all it handles
 
Yes, I have devise set up, and I have a User model, with profiles, images songs, videos etc.
 
okay
btw are you new to rails?
 
7:33 PM
Everything works fine, videos, music, images upload no problem
But I'm trying to put all user 'settings' into one place, the registrations edit page seemed perfect as it already has all the user options
 
I'm fairly new yes
 
no problem, good on you for learning
 
In the edit registrations view, I have the Videos form, which when I submit, fires the video controller and creates everything as it should
 
7:35 PM
But the song upload form fires off the registrations controller, and as its not a nested resource, does nothing
 
I have gotten rid of playlists as they wern't needed, and I have songs and videos practically identical
models, controllers and routes
 
which action does songs invoke in the registrations controller?
 
In the 'edit' part of the registrations controller I have:
@video = Video.new and @song = Song.new
 
7:38 PM
I'm not sure that nested resources are necessary (correct me if im wrong) as Ill only allow song and video upload from this one page, so as long as the redirects are the same it shouldn't matter
 
yea, the nested resources don't matter in this respect
so video works when you submit?
and song doesn't?
 
Yes
 
let me check your controller again
 
When I submit, looking at the server logs I see that it uses the video controller to create it
 
okay
and songs goes to registrations controller?
 
7:40 PM
yes
the songs controller doesn't get touched according to the server logs
so the page just refreshes
 
ok
let me check your code
 
shall I post here?
 
sure
 
I have changed some things since the original post
what would you like to see?
 
okay
the songs form
 
7:42 PM
<%= simple_form_for Song.new do |s| %>
<%= s.file_field :audio %>
<%= s.button :submit, class: 'add-song-btn' %>
<% end %>
the videos form is the same
 
<%= simple_form_for @video do |f| %>
<div class="add-video-input-box">
<%= f.input :youtubeurl, label: 'Add a Youtube URL' %>
<%= f.button :submit, class: 'add-video-btn' %>
<% end %>
 
can you show me the outputted HTML for this?
for the "songs" form ?
 
sorry
 
for what?
 
7:43 PM
the songs form is @song, not Song.new
 
its okay, they'd do the same thing anyway
 
yeah
 
I'm trying to figure out why songs is submitting to registrations controller
 
<div id="user-music-box">
<p class="p-details-title"> Upload Music </p>
<input type="hidden" value="✓" name="utf8">
<input type="hidden" value="DrHvC0e0I66XtVQI6Fz/sE9H2kAPa75Katy8zxqInxuwgYAXG6+CxN4coR2qPLKWnVTwCALgUP+NZbvxI6coxw==" name="authenticity_token">
<input id="song_audio" type="file" name="song[audio]">
<input class="btn add-song-btn" type="submit" value="Create Song" name="commit">
 
can you see the <form> tag anywhere near tat code?
 
7:46 PM
actually no
and the video part does have a form id
 
oh really
perhaps we've found our problem
can you try replacing your <%= simple_form_for @song do |f| %> with <%= form_for @song do |f| %>
 
Just done that, but the html is the same
 
hmmm interesting
what about removing the video form (for now) and seeing if it will render the song form
if you have a submit button without corresponding form, it will just reload the page
 
Just removed the video part, but the song html stays the same
 
hmm okay
can show you me the entire html for the page? maybe I'm missing something
 
7:51 PM
with or without the videos form?
 
without plz
 
I am copying the html from firebug, is there a better way?
 
right-click > view source
 
on it
<!DOCTYPE html>
<body>
<div id="header">

<head>
<link href='https://fonts.googleapis.com/css?family=Raleway:200' rel='stylesheet' type='text/css'><html>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places">
</script>
<script src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js"></script>
<script src='//google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/src/infobox_packed.js' type='text/javascript'></script>
 
wow, lots of JS
 
7:54 PM
Yes, iv'e not sorted the asset pipeline yet
only for css
 
<form novalidate="novalidate" class="simple_form new_song" id="new_song" enctype="multipart/form-data" action="/songs?locale=en" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="authenticity_token" value="OPpxCeHELajPYwEAVfgU/BULFYkLxIBktsFNgWiDKvGGyh4Vvd+MwobK9BUXmFnaxxg/wQZPbtFReEq/UaydLQ==" />
<input type="file" name="song[audio]" id="song_audio" />
<input type="submit" name="commit" value="Create Song" class="btn add-song-btn" />
 
so its currently loading everything on every page
 
that suggests it should hit the songs path
would you mind going on teamviewer?
 
sorry im a newb
teamvierwer?
 
its a program
which allows me to go on your PC
and see what's going on
teamviewer.com
 
7:56 PM
checking it out now
it's downloading
 
thanks
you from uk or us?
 
Originally UK
living in Spain
 
oh nice
 
not really!!
 
how'd that happen?
 
7:58 PM
I was 21 and got bored in the UK, so I put all my stuff in my car and drove down
Been here 7 years now
 
very nice
 
but as there's very little work, Im trying to start a website
 
good!
i heard about the work issue
 
Where abouts in the UK are you from?
yes, it's aweful here
 
also that spain's self employment structure is fucked
liverpool
 
8:00 PM
its terrible. You have to pay 312 euros a month as 'being self employed' tax, no matter what you're earning
 
So i've registered myself in the uk!!
 
i was in paris last year and a woman I was sitting next to ws doing the same thing
registered in the uk, worked from barcelona
she made clothes
 
It's impossible for startups here
Iv'e installed teamviewer
 
nice you just have to give id and pwd
 
8:02 PM
id: 314 056 411
pass: 9876
 

last day (15 days later) »