ga-wdi-boston / full-stack-project Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
TLDR; We expect you to ask good questions. What is good? Read on.
Muad'Dib learned rapidly because his first training was in how to learn. And the first lesson of all was the basic trust that he could learn. It's shocking to find how many people do not believe they can learn, and how many more believe learning to be difficult. Muad'Dib knew that every experience carries its lesson.
– Dune, Frank Herbert
This text addresses a fundamental point: the critical exploration of the self in the context of the critical exploration of the world. This text aims to shed some light on the matter by expanding on a simple idea: the process that leads to asking a question.
When my father was a teenager, in the late fifties, his science teacher used to ask the following question:
If we had a machine that could give you the answer to any question you had, would there be any point in doing science?
And here is the answer this same teacher gave:
Yes! Because the point of science is to ask questions. The answers are just the work.
This is a very important idea. Sure, science put dogs and people in space, but the only reason this became possible was because people asked the questions that led us to this result.
In order to ask the question, you have to evaluate the situation and understand what is not clear sufficiently to word it. This exercise is very valuable, as it trains you to recognize situations and problems. Being mindful of what you do as you do it is very helpful, as it shortens the evaluation time. It is usually equally important to be mindful of why you do what you do, as knowing the goal can help frame your question.
Knowing the answer means at the very least that now the question is out of the way. With luck, it was the correct question, and now we can proceed to other interesting ideas and problems. Otherwise, one must endeavor to find another, better question, closer to what the actual problem is.
Being a developer means crystallizing a vague problem that people have into a concrete set of behaviors which distil down to a solution. Being a developer means being able to think, connecting ideas and questions into patterns old and new. Learning to code is just learning to put characters next to each other. Eventually, even monkeys can write Shakespeare. Typing the code is irrelevant; writing code does not a developer make. Code is just the byproduct of the mental process that leads you to the choices of behaviors you are implementing. What you are truly learning to do is learning to ask questions – and work your way to the answer. Every single time you don't practice asking a question, you are robbing yourself of what you came here to do.
The work of asking the right question is not optional. You have to do it, because it will be your constant companion in the future.
Unfortunately, this is not a History or Geography course. The topics we discuss and teach aren't simple matters of memorization, and the questions are rarely as simple as "I forget where Zimbabwe is". They usually are more like "I'm trying to get this particular set of data out of my storage layer and transform it into such a way that it is available for presentation with a simple each loop when I go to this URL, but SOMETHING IS GOING WRONG"
Sometimes, saying "help" means "I'm really confused by what is happening, I am at my wits' end and I need someone to help me re-center so I can continue doing the work"
When that's the case, please explain that out in the way which is appropriate for your current situation. This will help us understand the context, the words, and the question.
When you want someone to answer a question, a few things need to happen:
Let's go through a few examples and examine how they fit the criteria:
The context is clear: we're trying to run a Ruby file. The words are clear - a file isn't working. The question is unclear, because there are many, many possible reasons for a Ruby file to not work.
The context is unclear. Which homework? The words are clear - it's got to do with homework. The question ... Well, it's not a question.
The context is unclear: why can you not run the server? The words are clear: we want to run a server on port 80 and we're unable to. The question is unclear: do we want to know how to do it or why it doesn't work?
The context is clear: the timestamp code of the Bookmark application. The words are clear: we want to refactor existing code. The question is unclear, but that's probably because how to refactor is usually a nebulous question.
The context is clear: the "book and lyn" assignment. The words are clear, there's a question about the design. The question is unclear - "this logo" is pretty dependent on what the person asking the question is thinking about at the time.
This is an interesting example, because it is simply an error message. However, here's the thing:
The context is clear. This error message means one thing and one thing only, and has a particular context attached with it. The words are inexistent. The question is also inexistent, but we assume whoever posted this got stumped.
The context is clear - the file circle.rb
has a SyntaxError on line 4. The words indicate that the person has read the error message and tried to figure it out. The question is "I'm out of ideas, I don't know what's wrong".
I'm sure by now you can see where this fails to meet the standard.
In order to receive help on an issue you are having during your development process you must submit a Github Issue for your project. Below is a guide for the information that must be included when submitting an issue. It is expected that you will try to debug/solve an issue prior to submitting a request for help on Github.
When submitting an issue provide some context as to what the problem is. This includes but is not limited to:
Give information about what you have done to solve the problem. Including but not limited to:
What would you like help with specifically?
For an example: how to ask questions
I have Item belongs to Collection but when I call Item.create on a collection, it doesn't work.
I was having trouble with a delete function in a controller so I stripped everything out of it:
def destroy
end
and it still reports and error (in server window), I'm confused about where the second query is coming from:
Started DELETE "/messages/1" for ::1 at 2015-11-10 13:45:25 -0500
Processing by MessagesController#destroy as HTML
Parameters: {"id"=>"1"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."token" = $1 LIMIT 1 [["token", "81d3f9418f2c65c04055f50239265398"]]
Message Load (0.3ms) SELECT "messages".* FROM "messages" WHERE "messages"."id" = $1 LIMIT 1 [["id", 1]]
Completed 404 Not Found in 3ms (Views: 0.9ms | ActiveRecord: 0.6ms)
I wrote my jquery for logout in my ajax.js file and now that it is in the file, my login jquery will not work anymore. Not sure how if this is an issue of location in my file or what.
Modeled it after the many through movies controller to set my join table controller but curious
class BeersController < OpenReadController
before_action :set_beer, only: [:update, :destroy]
# GET /beers
def index
@beer_choices = Location.beer_choices
render json: @beer_choices
end
# GET /beers/1
def show
@beer_choices = Location.find(params[:id])
render json: @beer_choices
end
# POST /beers
def create
@beer = current_user.beers_choices.new(beer_choices_params)
@beer_choices.save
if @beer_choices.save
render json: @beer_choices, status: :created, location: @beer_choices
else
render json: @beer_choices.errors, status: :unprocessable_entity
end
end
# PATCH /beers/1
def update
if @beer_choices.update(beer_choices_params)
head :no_content
else
render json: @beer_choices.errors, status: :unprocessable_entity
end
end
# DELETE /beers/1
def destroy
@beer_choices.destroy
head :no_content
end
def set_beer_choices
@beer_choices = current_user.location.find(params[:id])
end
def beer_params
params.require(:beer_choices).permit(:location_id, :beer_id)
end
private :set_beer_choices, :beer_params_choices
end
end
def destroy
@messages = User.find(params[:id]).messages
@messages.destroy
head :no_content
end
not sure where to go from here, @messages = User.find(params[:id]).messages gets the messages I want to destroy
Current Data structure:
User (has many) --> Weekly Menus (has many Recipes through Meals) --> Meals (belongs to weekly menus and recipes) --> Recipes (has many meals)
When logged in as User, when I try to create a Recipe via POST, I get a an error message that says undefined method "recipes" for User. I'm pretty sure that is because I have not set any "has_many, through" associations for Users and Recipes. I am not even sure that association is even necessary via how I am calling my data, so I'm wondering if there is a way around it. I do not want to allow recipe creation without authentication.
I haven't been able to get my backend to work in heroku. most recently the message is that the page doesn't exist. I've gone through the readme steps three times on my own, made sure all my branches are up to date, and tried to trouble-shoot from console error messages, though I am not getting any this time.
Also, I'm trying to figure out if using a counter in my db will be helpful for my program, but I'm a little unclear from the rails api documentation and other sources that I have looked at, if it is necessary or if I am using it correctly.
Thanks!
This is the code in my WeeklyMenusController < OpenReadController:
def index
@weeklymenus = WeeklyMenu.where(user_id: current_user)
render json: @weeklymenus
end
My current_user has an ID of 5, and I'm trying to get my GET request to return all WeeklyMenus associated with User_ID 5.
Query does not return any ActiveRecord objects with user_id: 5.
Still getting the following error:
Started OPTIONS "/words" for ::1 at 2015-11-11 09:42:15 -0500
Started POST "/words" for ::1 at 2015-11-11 09:43:41 -0500
Processing by WordsController#create as HTML
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."token" = $1 LIMIT 1 [["token", "a450ec1665e8e449bcd43e3e4c10cdbd"]]
Completed 400 Bad Request in 1ms (ActiveRecord: 0.3ms)
ActionController::ParameterMissing (param is missing or the value is empty: word):
app/controllers/words_controller.rb:42:in `word_params'
app/controllers/words_controller.rb:17:in `create'
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (3.5ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.8ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.3ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (45.2ms)
It's not even hitting my database. Trying to use the curl commands in the README for the api. Grabbing a token from the server and plugging it in.
My controllers are inheriting from OpenReadController and at least Locations worked when it was inheriting from ApplicationController
Would like to just go over my data model and make sure I'm heading in the right direction before I delve to deep.
I have all of it done, I just need advice on whether to put a "Create Topic" on each honey's profile listing or as a stand alone button.
I'm trying to deploy my app on heroku, and I'm getting a "The page you were looking for doesn't exist." error. I fixed some of the problem (or at least created more different problem!) by going through the deployment repo again, but I'm still getting errors, and I'm not sure what they mean. It seems like it is requesting things from the path "/", and I'm not surprised that it's not getting what it wants from that path, but I'm not sure how or what to change.
The logs say:
2015-11-10T19:04:49.634473+00:00 heroku[router]: at=info method=GET path="/" host=mighty-shelf-9974.herokuapp.com request_id=d7e7f4cd-9cd1-4068-a007-3763688399eb fwd="157.130.220.250" dyno=web.1 connect=14ms service=62ms status=404 bytes=1744
2015-11-10T19:25:06.061120+00:00 heroku[router]: at=info method=GET path="/" host=mighty-shelf-9974.herokuapp.com request_id=7c53cf0f-a5aa-45a9-9682-12c999a2dc94 fwd="157.130.220.250" dyno=web.1 connect=1ms service=150ms status=404 bytes=1744
2015-11-10T19:25:06.257192+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=mighty-shelf-9974.herokuapp.com request_id=fb12cd91-8d66-469d-97d9-6f154e09fcc5 fwd="157.130.220.250" dyno=web.1 connect=16ms service=4ms status=304 bytes=48
Error when PropertiesController invoked from Browser
Started POST "/properties" for ::1 at 2015-11-11 09:55:22 -0500
Processing by PropertiesController#create as HTML
Parameters: {"{"property":{"no":"12","street":"Fuller Street","city":"Sheldon","state":"NH","zip":"34876","house_mgmt_co":"Holsten Holdings","manager":"Matt Savrest","user_id":3}}"=>nil}
User Load (1.5ms) SELECT "users".* FROM "users" WHERE "users"."token" = $1 LIMIT 1 [["token", "4cc8af9ed51fe85dd117c0d615a2621a"]]
Completed 400 Bad Request in 5ms (ActiveRecord: 1.5ms)
ActionController::ParameterMissing (param is missing or the value is empty: property):
app/controllers/properties_controller.rb:48:in property_params' app/controllers/properties_controller.rb:18:increate'
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (3.5ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.8ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (43.6ms)
Successful completion when add property invoked via curl
Started POST "/properties" for ::1 at 2015-11-11 10:07:22 -0500
Processing by PropertiesController#create as /
Parameters: {"property"=>{"no"=>"56", "street"=>"Weston Drive", "city"=>"Ashton", "state"=>"KY"}}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."token" = $1 LIMIT 1 ["token", "4cc8af9ed51fe85dd117c0d615a2621a"] BEGIN
SQL (1.0ms) INSERT INTO "properties" ("no", "street", "city", "state", "user_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" ["no", "56"], ["street", "Weston Drive"], ["city", "Ashton"], ["state", "KY"], ["user_id", 3], ["created_at", "2015-11-11 15:07:22.955276"], ["updated_at", "2015-11-11 15:07:22.955276"] COMMIT
Completed 201 Created in 17ms (Views: 1.8ms | ActiveRecord: 2.4ms)
So I've been able to to test the user registration/login and routes in postman, but my db isn't updating when I register from the front end. I added an alert code to my main js file to make sure they are linked and working, and I get the alert message when I log in, and I have checked the web console for errors and don't have any.
Can I get someone to look at my api.js file?
Thanks!
Need help using ajax to login to my server
At the end of my login.on() method I have a console.log("You logged in") and $('.login-block').hide(); to display that I did, in fact, log in. I put debuggers in between every line of my code to see how each line is working. Going through each line piecemeal, everything seems to be working. However, once I exit the .on() method the website seems to refresh and the console doesn't display anything and the html isn't hidden. No error messages are being displayed either.
Here's the message: uninitialized constant ActionController::API
I'm trying to make sure that all is well with users controller/routes that I copied from Antony's api.
So far, I've google searched the error message
read through some stack overflow posts
I've checked to make sure that classes match controller names
checked with classmates, had them look at my code in case I missed something
So my question is, how do I initialize constant ActionController::API?
class ItemsController < ApplicationController
#GET /items
def index
#show all iems
@items = Collection.find_by_id(params[:collection_id]).items.all
render json: @items
end
#GET /items/1
def show
#show a particular item
@item = Collection.find_by_id(params[:collection_id]).items.find(params[:id])
render json: @item
end
#POST /items
def create
@item = Collection.find_by_id(params[:collection_id]).items.new(item_params)
if @item.save
render json: @item, status: :created,
location: @item
else
render json: @item.errors, status: :unprocessable_entity
end
end
#PATCH /items/1
def update
if @item.update(item_params)
head :no_content
else
render json: @item.errors, status: :unprocessable_entity
end
end
#DELETE items/1
def destroy
@item.destroy
head :no_content
end
def set_item
#look up items owned by current user
# @item = Collection.find_by_id(params[:collection_id]).items.find(params[:id])
@item = current_user.items.find(params[:id])
end
def item_params
params.require(:item).permit(:name, :photo_url, :description)
end
private :set_item, :item_params
end
I have items resources nested within collections resources.
A collection has many items.
Item belongs_to collections relationship.
Creating beers at the same time, where beers are linked to establishment. Need a few minutes to figure out how to link them in the data structure.
I'm having issues with testing my controllers on Postman
Just re-migrated "sites".
I can do Site.new (with all attributes) in rails console. The table looks fine in rails db.
But when I try to create a new site in curl, I can't, and I get this error:
ActionDispatch::ParamsParser::ParseError
Here's what I'm typing into the console, after logging in the user who will author the "site" and taking that token:
curl --request POST --header "Authorization: Token token=2f6ec10093655ee88450e15cba76de36" --header "Content-Type: application/json" -d '{
"site": {
"name":"Stairs",
"description":"Short-range people watching",
"category":"Seating",
"address":"1801 Mass Ave",
"neighborhood":"Porter Square",
"scale:"medium",
"coverage":"minimal",
"busy":"somewhat"
}
}' http://localhost:3000/sites
Where else should I look for issues?
A create Profile request. Am able to use postman to write to the URL but cannot use my API to write, keep reaching this error.
This is a 2 for one. Scott and I are having problems with a POST curl command
curl --request POST --header "Authorization: Token token=be249dc0231396806f24c953cafae03a" --header "Content-Type: application/json" -d '{ “guide": { “name”:"English" } }' http://localhost:3000/guides
getting a parsing error and weve spent a good hour looking up whats wrong
def create guide = current_user.guides.create(guide_params) if guide.save render json: guide, status: :created else render json: guide.error, status: :unprocessable_entity end
def guide_params params.require(:guide).permit(:name) end
Figured this is a separate issue from the registration issue, so I thought I'd be fair and submit a separate issue. I've written out my app logic and have started trying to group similar events together to write the js functions, but I'd like some guidance on laying all of this out. I tried to talking it through to my cat this morning with some success, but I'm ready for a knowledgable human.
Below is the outline of data tables and what users need to be able to do with that data.
Stories
The most recent completed story is available to read on the login/registration page
Stories are complete when Outline changes
The story in progress is visible only after a contribution is submitted
Outines
Outlines are provided from the database upon login
Outlines change every ten Contributions
Clues
Users receive clues from the previous user upon login, unless you are the first user
After they submit their contribution, users submit clues for the next user
Contributions
Users make a contribution and submit it upon login
A contribution is appended to the story in progress after submission
Stories are made up of ten contributions
Thanks!
I'm trying to access data from the server using Handlebars, and I can get data using the {{#each}} method, but outside if it I can't seem to get at the data. (It simply doesn't display) I suspect what I want to do is not possible (I looked at the docs, and it depends on the definition of 'simple path') I'd like someone to take a look and tell me it's impossible before restructuring my app to get the info a different way.
My register/POST requests ARE working. I can enter the email/password into my front-end application and they DO get saved to my users table in my database, yay!
My Question: What I'm curious about is this, when I tested it in postman why does it say current_user: false? Is current_user always false? Like I said it seems to be functioning, but I was curious.
{"user":{"id":4,"email":"[email protected]","current_user":false}}
My curl is giving me error "NoMethodError (undefined method comment' for #<Comment:0x007fb2f52c2f90>): app/controllers/auth_controller.rb:9:in
login'" but I haven't changed the auth_controller. Can I get some in-person help please tonight?
I have been making many commits, but I forgot to push. When I run git push -u origin database it says origin is not a database.
I've done a quick check on the bootstrap document and it's not immediately evident how to accomplish the following: I want to create a table that has rows of wines. When want to be able to select a row then click a button to initiate further action on the item in the selected row
My logout function seems to be working but after I logout and type user.token in the DOM console the token hasn't been cleared.
I'm entering a word into a searchbar and based on what word I enter I'm trying to have my database update the frontend where a previously created word, definition, and sample sentence have been stored.
So... I can successfully register and login a user through the backend and the frontend through AJAX requests. I can successfully do GET requests to the backend and receive data to use in my frontend (i.e., populate a div with data collected from the backend).
I can successfully create a new bike from the backend using pry and using Postman using authentication.
However. I cannot successfully create a new bike POST from the front end.
The error message I am receiving when I attempt to do an ajax POST request is:
POST http://localhost:3000/bikes
localhost/:1 XMLHttpRequest cannot load http://localhost:3000/bikes. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:5000' is therefore not allowed access. The response had HTTP status code 500.
see attached image
I have googled, I have asked classmates, I've looked at my Rails backend to see if there's an issue. I'm not sure if my bikes_controller.rb file is not set up correctly for creating a new bike.
Similar question to Jeff's earlier; I've gone through the lessons and I think I just need to run through CRUD as it relates to my project with someone. One specific issue: Because I added conditions to the queries in my models (I think this is maybe the right way to say that?) I don't know which words to point to in my routes. Or, here are my models and I don't know if I should get sites or my_sites, etc.:
class User < ActiveRecord::Base
has_many :my_sites, class_name: 'Site'
end
class Site < ActiveRecord::Base
belongs_to :creator, class_name: 'User'
end
Sorry -- this isn't elegantly asked.
I have a books table and a ratings table. A book has_one rating, and a rating belongs_to book.
When I make a GET request to http://localhost:3000/books I would like to get data back on the books as well as their ratings. I am not sure how to structure the books controller to do this?
I tried making a an instance variable @Rating to hold book.rating, and then rendering this in json, ...didn't work.
Can't quite figure out what's wrong with my createWord method. I keep getting the following error:
Started POST "/words" for ::1 at 2015-11-10 16:07:35 -0500
Processing by WordsController#create as HTML
Parameters: {"words"=>"hi"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."token" = $1 LIMIT 1 [["token", "5eff73f3f4efebaf181524701fe03f6f"]]
Completed 400 Bad Request in 1ms (ActiveRecord: 0.2ms)
ActionController::ParameterMissing (param is missing or the value is empty: word):
app/controllers/words_controller.rb:42:in `word_params'
app/controllers/words_controller.rb:17:in `create'
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (3.6ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.9ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms)
Rendered /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (42.8ms)
I'm trying to do a different kind of thing with file uploading than we talked about this morning. I want to upload a csv file, save it's data to the database, and not save the file. I've been looking at http://guides.rubyonrails.org/form_helpers.html#uploading-files, but I'm having trouble understanding it/applying it to my project. I'd love to talk through the steps with someone.
Here is my curl request:
curl --include --request POST --header "Content-Type: application/json" -d '{
"credentials": {
"email": "[email protected]",
"password": "an example password",
"password_confirmation": "an example password"
}
}' http://localhost:3000/register
Here is the error:
Started POST "/register" for ::1 at 2015-11-11 13:19:55 -0500
Processing by AuthController#register as /
Parameters: {"credentials"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}}
(0.2ms) BEGIN
User Exists (0.5ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = '[email protected]' LIMIT 1
SQL (1.7ms) INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "token") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["email", "[email protected]"], ["password_digest", "$2a$10$ci6ZIs0XYsXeeYlJOH0zQ.ump8PE3HQWBnKSkE66SUPQdiht3W/wy"], ["created_at", "2015-11-11 18:19:55.375057"], ["updated_at", "2015-11-11 18:19:55.375057"], ["token", "a8157740c31ed7324cbb1250bf069076"]]
PG::NotNullViolation: ERROR: null value in column "name" violates not-null constraint
DETAIL: Failing row contains (12, [email protected], a8157740c31ed7324cbb1250bf069076, $2a$10$ci6ZIs0XYsXeeYlJOH0zQ.ump8PE3HQWBnKSkE66SUPQdiht3W/wy, 2015-11-11 18:19:55.375057, 2015-11-11 18:19:55.375057, null, null).
: INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at", "token") VALUES ($1, $2, $3, $4, $5) RETURNING "id"
(0.2ms) ROLLBACK
Completed 500 Internal Server Error in 97ms (ActiveRecord: 2.6ms)
Just need a few minutes help to get me on the right track and oriented, please. My backend curl commands work just fine.
I have looked online and added the forms. I would appreciate a little help seeing for the forest for the trees on this one. I run through our lessons but it's not clicking.
Whenever I run rake db:seed I keep getting an error of unknown attribute kind for crop.
Please help me resolve this issue.
I am trying to bulk load a csv file into my database. I have run 'rails g task db parks' then updated the rake.db file using the rails-crud lesson as an example. Then I ran 'rake -T db:populate'. The terminal runs it successfully, but when I look at the database itself after running 'SELECT * FROM parks' it shows that I have 0 rows.
So... I've successfully created a one-many relationship between two tables, however, I'm not sure if I've created the models correctly to integrate with the other model (or two) that I'm looking to use for this project.
I have the a map of the erd, yet I'm not sure my thought process is sound with respect to tying together certain relationships between users and my models. Can someone look at my erd and how I've set up my models so I can be sure I'm on track when I try more tests with dummy data?
My patch request in my profiles controller is wrong. Server response involves:
Started PATCH "/profiles/?user_id=1" for ::1 at 2015-11-11 12:24:14 -0500
ActionController::RoutingError (No route matches [PATCH] "/profiles"):
Controller looks like this:
# PATCH /profiles/1
def update
if @profile.update(update_params)
head :no_content
else
render json: @profile.errors, status: :unprocessable_entity
end
end
referencing this:
def update_params
params.require(:profile).permit(:nickname, :zip_code, :user_id)
end
I am having trouble controlling what is hidden and what is showing in my app. I have a ux.js file for controlling the state of the page view and determine which elects are hidden. But for some reason certain elects are not hiding when they should be.
I have tried changing the order in which I load my scripts. And I have tried putting a couple js functions in a $(document).ready wrapper. But ca't figure it out.
Thanks!
I log in with a user and take the token i receive from the server.
When trying to create a profile with that token, I receive "HTTP Token Access Denied".
The controller looks like this:
def create
@profile = current_user.create_profile(profile_params)
if @profile.save
render json: @profile, status: :created, location: @profile
else
render json: @profile.errors, status: :unprocessable_entity
end
end
This works if I try to create a profile within the rails console, so i'm not sure what i'm missing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.