{"action":"created","issue":{"url":"https://api.github.com/repos/PENGZhaoqing/CourseSelect/issues/57","repository_url":"https://api.github.com/repos/PENGZhaoqing/CourseSelect","labels_url":"https://api.github.com/repos/PENGZhaoqing/CourseSelect/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/PENGZhaoqing/CourseSelect/issues/57/comments","events_url":"https://api.github.com/repos/PENGZhaoqing/CourseSelect/issues/57/events","html_url":"https://github.com/PENGZhaoqing/CourseSelect/issues/57","id":194920943,"number":57,"title":"添加筛选课程功能的几个疑问","user":{"login":"5663015","id":8531141,"avatar_url":"https://avatars.githubusercontent.com/u/8531141?v=3","gravatar_id":"","url":"https://api.github.com/users/5663015","html_url":"https://github.com/5663015","followers_url":"https://api.github.com/users/5663015/followers","following_url":"https://api.github.com/users/5663015/following{/other_user}","gists_url":"https://api.github.com/users/5663015/gists{/gist_id}","starred_url":"https://api.github.com/users/5663015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/5663015/subscriptions","organizations_url":"https://api.github.com/users/5663015/orgs","repos_url":"https://api.github.com/users/5663015/repos","events_url":"https://api.github.com/users/5663015/events{/privacy}","received_events_url":"https://api.github.com/users/5663015/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-12-12T09:01:02Z","updated_at":"2016-12-13T14:28:18Z","closed_at":null,"body":"界面大致如下：\r\n![image](https://cloud.githubusercontent.com/assets/8531141/21093240/b471c92c-c08b-11e6-8497-dcfbe5bf6f63.png)\r\n拿“学时/学分”选项和按钮代码示例：\r\n\r\n```\r\n<label for=\"name\">学时/学分</label>\r\n<select class=\"form-control\" , style=\"width:150px\">\r\n      <option value =\"1\">60/3.0</option>\r\n      <option value =\"2\">40/2.0</option>\r\n</select>\r\n    <td><% @course.credit = \"60/3.0\" %></td>\r\n\r\n&nbsp\r\n<%=link_to \"筛选\", filter_course_url(@course),class: 'btn btn-xs btn-info' %>\r\n&nbsp\r\n<%=link_to \"刷新\", refresh_course_url(@course),class: 'btn btn-xs btn-info' %>\r\n\r\n```\r\n实际上只要加入<td><% @course.credit = \"60/3.0\" %></td>这句就会出现下面错误：\r\n![image](https://cloud.githubusercontent.com/assets/8531141/21093316/1780ea34-c08c-11e6-9e1b-9ad4d572d04d.png)\r\n我的疑问是如何将选好的筛选条件赋给course变量的credit、course_type等属性，并在控制器中根据这些属性将符合条件的课程筛选出来？另外刷新页面功能有什么思路吗，查了一下都是用JS实现的。谢谢~\r\n"},"comment":{"url":"https://api.github.com/repos/PENGZhaoqing/CourseSelect/issues/comments/266752081","html_url":"https://github.com/PENGZhaoqing/CourseSelect/issues/57#issuecomment-266752081","issue_url":"https://api.github.com/repos/PENGZhaoqing/CourseSelect/issues/57","id":266752081,"user":{"login":"PENGZhaoqing","id":11887913,"avatar_url":"https://avatars.githubusercontent.com/u/11887913?v=3","gravatar_id":"","url":"https://api.github.com/users/PENGZhaoqing","html_url":"https://github.com/PENGZhaoqing","followers_url":"https://api.github.com/users/PENGZhaoqing/followers","following_url":"https://api.github.com/users/PENGZhaoqing/following{/other_user}","gists_url":"https://api.github.com/users/PENGZhaoqing/gists{/gist_id}","starred_url":"https://api.github.com/users/PENGZhaoqing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PENGZhaoqing/subscriptions","organizations_url":"https://api.github.com/users/PENGZhaoqing/orgs","repos_url":"https://api.github.com/users/PENGZhaoqing/repos","events_url":"https://api.github.com/users/PENGZhaoqing/events{/privacy}","received_events_url":"https://api.github.com/users/PENGZhaoqing/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T14:28:18Z","updated_at":"2016-12-13T14:28:18Z","body":"params用错了，params是一个至少两层以上的hash，你要获得的参数在course下面，例如`params[:course][:credit]`（我上面写的你都不看的啊）\r\n\r\n不确定的情况下，使用`puts params[:course][:credit]`，把这个变量在log里打印出来看到底有没有\r\n"}}
{"actor":{"display_login":"PENGZhaoqing"}}