{"action":"created","issue":{"url":"https://api.github.com/repos/fsek/web/issues/245","labels_url":"https://api.github.com/repos/fsek/web/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/fsek/web/issues/245/comments","events_url":"https://api.github.com/repos/fsek/web/issues/245/events","html_url":"https://github.com/fsek/web/pull/245","id":108478455,"number":245,"title":"External links library","user":{"login":"kotrfa","id":2741256,"avatar_url":"https://avatars.githubusercontent.com/u/2741256?v=3","gravatar_id":"","url":"https://api.github.com/users/kotrfa","html_url":"https://github.com/kotrfa","followers_url":"https://api.github.com/users/kotrfa/followers","following_url":"https://api.github.com/users/kotrfa/following{/other_user}","gists_url":"https://api.github.com/users/kotrfa/gists{/gist_id}","starred_url":"https://api.github.com/users/kotrfa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kotrfa/subscriptions","organizations_url":"https://api.github.com/users/kotrfa/orgs","repos_url":"https://api.github.com/users/kotrfa/repos","events_url":"https://api.github.com/users/kotrfa/events{/privacy}","received_events_url":"https://api.github.com/users/kotrfa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fsek/web/labels/suggestion/feature","name":"suggestion/feature","color":"eb6420"},{"url":"https://api.github.com/repos/fsek/web/labels/work-in-progress","name":"work-in-progress","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-09-26T16:17:39Z","updated_at":"2015-10-09T18:58:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fsek/web/pulls/245","html_url":"https://github.com/fsek/web/pull/245","diff_url":"https://github.com/fsek/web/pull/245.diff","patch_url":"https://github.com/fsek/web/pull/245.patch"},"body":"According to [this](https://github.com/fsek/web/issues/239)  issue I tried to implement external links library. \r\n\r\nI am sorry for two previous wrong pull requests (they are closed now). I've just messed up my repos and now it's hopefully OK. \r\n\r\n# Description\r\nCurrent design of plugin is horrible since I mainly focused on functionality and not on design. And since I am horrible designer, it would be maybe better if someone else took it under his wings.\r\n\r\n* list of all links at /ex_links, then there are classic scaffold actions like new, show, edit...\r\n* images are saved in two dimensions in /public/system/images/ex_links/:id/(medium/thumb) <- hence in two sizes. If no image is specified, the default one from `/app/assets/images/img/ex_links/` is used instead.\r\n* tags are stored lowercase without white space and must be separated by commas. There is function in `ex_link_controller` called `query_by_tags(string_with_tags)` which returns all links which have combination of tags passed as argument to this function.\r\n* list of all tags can be found at `/ex_links/tags` with counter (how many times the tag has been used) and possibly list links with this tag using proposed API: `/ex_links?tag=tag1,tag2`. This is how you can filter links with specific combinations of tags.\r\n\r\n# Problems and ask for a help\r\n- [ ] Tests. I am unable to figure out how to write a proper test using rSpec. I would definitely need some help here. Furthermore, the model has `test_availability` field for testing availability. I am not sure where this test should be and if we want to test it every time you run rspec, which I wouldn't recommend (it's not necessary). These test should be in some separate test suite. \r\n- [ ] `expiration` field is for marking link as inactive after that day. It's handy for controlling links with limited life time. I am not sure where I should implement that periodical check. It might be in the same place where we would run tests for `test_availability` above.\r\n- [ ] How to do forms international?\r\n- [ ] How to do multiline string in HAML, so hound doesn't complain?\r\n\r\nThere are some TODOs in code and you are very welcome to help with them."},"comment":{"url":"https://api.github.com/repos/fsek/web/issues/comments/146961311","html_url":"https://github.com/fsek/web/pull/245#issuecomment-146961311","issue_url":"https://api.github.com/repos/fsek/web/issues/245","id":146961311,"user":{"login":"kotrfa","id":2741256,"avatar_url":"https://avatars.githubusercontent.com/u/2741256?v=3","gravatar_id":"","url":"https://api.github.com/users/kotrfa","html_url":"https://github.com/kotrfa","followers_url":"https://api.github.com/users/kotrfa/followers","following_url":"https://api.github.com/users/kotrfa/following{/other_user}","gists_url":"https://api.github.com/users/kotrfa/gists{/gist_id}","starred_url":"https://api.github.com/users/kotrfa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kotrfa/subscriptions","organizations_url":"https://api.github.com/users/kotrfa/orgs","repos_url":"https://api.github.com/users/kotrfa/repos","events_url":"https://api.github.com/users/kotrfa/events{/privacy}","received_events_url":"https://api.github.com/users/kotrfa/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T18:58:45Z","updated_at":"2015-10-09T18:58:45Z","body":"Hey. I have a problem implementing nested form.\r\n\r\nMy idea is as follows. When creating new external link, user should write tags separated by colons into simple text field (I will show user all currently used tags - this is not problem easy). This string will be then split into words and converted to lowercase. Then I will look up if there are existing tags with this `tagname`. If it is, than I just assign this tag to the created external link. If it is not, new `Tag` will be created with this name and then assigned to the external link.\r\n\r\nI can't figure out how and where should I do this logic. I tried several variants (from [here](https://github.com/plataformatec/simple_form/wiki/Nested-Models), [there](http://stackoverflow.com/questions/19347450/creating-multiple-nested-forms-using-simple-form-and-rails-4) or [there](http://railscasts.com/episodes/196-nested-model-form-part-1)), but nothing of those is what I am looking for. \r\n\r\nMay I ask for help here?"}}