Note that there are some explanatory texts on larger screens.

plurals
  1. USrobertlong
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. CO@post = User.find_all_by_email(params[:useremail]).posts.build(params[:post]) created another method in the posts controller that finds the user using a passed email, but now devise thinks it isn't authenticated. The console spits out: Started GET "/users/sign_in" for 127.0.0.1 at 2011-11-28 18:22:06 -0800 Processing by Devise::SessionsController#new as HTML Parameters: {"session"=>{"action"=>"new", "controller"=>"devise/sessions"}} Rendered devise/shared/_links.erb (1.0ms) Rendered devise/sessions/new.html.erb within layouts/application (60.5ms) Completed 200 OK in 605ms
      singulars
    2. COdef create @post = current_user.posts.build(params[:post]) This is the part that is causing problems. My android app isn't passing the current_user to rails and thus it shows up as a nil class. So, I'm guessing I have to get the current user from a session or something. I don't really know.
      singulars
    3. COOk, no routing errors, but the links still don't work. I'm pretty sure it has to do with the "@post = Post.find(params[:id])" in the tag definition and the "@posts = Post.search(params[:search], params[:page])" in the index definition. The index overrides the value of @post that was changed in the tag definition. Can I write an if statement that checks to see if the parameter passed was a search query or a tag? If so, how? I'm fairly new to Ruby and Rails and MVC in general, just trying to learn how everything is structured.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload