i'm having an weird problem, my project have a login page, that's working, but i have to use this login page using http shell commands like:
curl -v http://google.com/
My problem is, how can i identify the URL to send the request from the source code? Follow the source code:
def create
if request.post?
if session[:account] = Account.authenticate(params[:account][:username], params[:account][:password])
flash[:message] = "Login successful"
redirect_to :controller => "items", :action => "index"
else
flash[:notice] = "Login unsuccessful"
redirect_to :controller => "login", :action => "create"
end
end
end
If i try sent a request like this:
curl -d "account(username)=guilherme&account(password)=123456" http://localhost:3000/login
I have this response:
You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.[]
i did not really understand your question, but i think that the curl line you posted should use brackets instead of parenthesis
curl -d "account[username]=guilherme&account[password]=123456" http://localhost:3000/login
i am asking myself what you are going to do with this, because you are not going to be able to keep the session-cookies with this approach?!