How group_by on Rails | Fixed issues |
- How group_by on Rails
- Running multiple rake tasks in rails
- Fixtures in mail preview
- Why is rails app rendering without CSS after creating Cloudfront distribution?
- How to have a form in Rails that supports has_many associations, not yet existing
- Active record, results illustration
- Refactoring front end code by minimizing dependancies
- CanCanCan not stopping posts being edited
- Carrierwave returns path of tmp file instead of actual in a callback
- How do I get a dummy database to test my Rails 3.2 engine using minitest?
- iterating with ruby using an if else statement ...(along w. ancestry gem)
- tiny tds returning a dead connection object?
- How to protect visible email address from spam with gem for Ruby 4?
- Rails trying to get external database info with ActiveRecord::Base.connection_config
- Rails Polymorphic associations with name space
- Searching an external API through a rails form and displaying the results in the view
- Rails 5 Nested attributes "Unpermitted parameter" - Whitelisted
- HMT association 3 levels deep
- Post JSON body in rspec controller test in Rails 5
- CSS - text flow and centering
- Rails 3 Nested attributes get label and type dynamically
- PG::UniqueViolation: ERROR: duplicate key value violates unique constraint
- Can not create new user record on Rails api via Postman
- How to handle object list request
- How to test disabled field in ruby on rails and assert_select?
- An error occurred while installing pg (0.18.4), and Bundler cannot continue
- Twilio - The requested resource not found error. when sending sms messages
- How to skip inner Rails realisation when debugging with Pry?
- Updating rendered partial variable via ajax in Rails
- How to post to multiple job boards from my job board - Ruby on Rails
Posted: 15 Sep 2016 08:55 AM PDT I am pretty new to ROR and i'm in trouble to achieve this. I have a Working_hour Model and a Merchant Model, where merchant has_many working_hours and working_hour belongs to Merchant, as follow: Working hour table The merchant can have two working_hours for the same day. When I display at the view ordered by day the data retrieved are: How can I group the working_hours by days and display this way: I watched the group_by tutorial from the Railscast, but I don't have a controller to working_hour Model. Any ideas? |
Running multiple rake tasks in rails Posted: 15 Sep 2016 08:47 AM PDT So i have this I'm wondering if its possible to run these all at the same time? Sam |
Posted: 15 Sep 2016 08:36 AM PDT Having the following mailer previewer code: (full file). Which is unable to reach my fixtures ( Can we get fixtures entries from mailer previewer? If yes, I would like to know how to do that. If no, is there a way to preview the mail without sending as a parameter |
Why is rails app rendering without CSS after creating Cloudfront distribution? Posted: 15 Sep 2016 08:55 AM PDT My rails app isn't loading the css or js files now upon trying to implement page cache via cloudfront. I'm using heroku and I setup cloudfront based on these instructions: https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn Done: "To create a CloudFront distribution you will need an Amazon AWS account. Once logged in you can go to the CloudFront control panel and select 'Create distribution'. When prompted for the delivery method, select 'Web'." I then added to rails production.rb: What could have gone wrong with www.anthonygalli.com? I think I followed all the steps. |
How to have a form in Rails that supports has_many associations, not yet existing Posted: 15 Sep 2016 08:24 AM PDT Suppose each Problem is, this generates the following HTML for each Where I would expect it to generate this: What am I doing wrong here? |
Active record, results illustration Posted: 15 Sep 2016 08:34 AM PDT Can someone explain this? While p_date is only date type without time. Thank you |
Refactoring front end code by minimizing dependancies Posted: 15 Sep 2016 08:10 AM PDT Large web applications tend to accrue a huge array of libraries that support both front-end and back-end functionality. I want to reduce the number of dependencies in order to increase stability and ease of maintenance. I'm looking for a good path to reducing dependencies in a web app that includes libraries such as:
I'm looking for techniques, languages, or frameworks that combine as many of those dependencies as possible. Here's what I've explored so far: Refactoring small dependencies and removing unused parts could go a long way. React would impose discipline on the jQuery spaghetti code and reduce the need for a few of the dependencies. Elm would go farther towards imposing discipline with its type safety. ClojureScript would also impose discipline through a functional programming paradigm. Except for refactoring, all of these potential solutions would introduce some additional complexity of their own in order to integrate with the Ruby on Rails back-end. React seems to have the most replacements for the current dependencies. The safest path forward seems to be to start with refactoring and gradually introduce one of the functional languages or libraries. How would I refactor with this goal in mind? Would first refactoring to plain JS (i.e. removing jQuery) be useful? |
CanCanCan not stopping posts being edited Posted: 15 Sep 2016 08:31 AM PDT I'm making a rails project, and I'm trying to implement CanCanCan. I installed the gem and the ran the commands. I then added this to However, now in my project, if I sign into a different user, I can still edit other users posts. Any help with what I'm missing will be greatly appreciated. |
Carrierwave returns path of tmp file instead of actual in a callback Posted: 15 Sep 2016 07:57 AM PDT In an application I wanted to send public file URL to a service in an To my frustration, after the upload, the So, the question is, how do you obtain a final file URL in a situation like this? P. S. Please note, this is a self-answered question, I just wanted to share my experience. |
How do I get a dummy database to test my Rails 3.2 engine using minitest? Posted: 15 Sep 2016 07:56 AM PDT I'm working on an existing Rails 3.2 site and have been tasked with adding tests to one of the engines using Minitest. My underlying issue here is that there are no rake tasks available beyond
Therefore, I have no access to db:create, db:test:prepare, etc. I've manually created the test database and one of the tables. However, for all my tests, I now receive the following error: |
iterating with ruby using an if else statement ...(along w. ancestry gem) Posted: 15 Sep 2016 08:04 AM PDT Recently started with Rails and am presently using ancestry gem for the first time ... I am attempting to iterate thru a class of Category objects, that which are stored in a tree structure via the ancestry gem, in order to display buttons,wired to 'link_to' to other category objects, a given category is related to. The first 3 categories in the database are the roots, and so I will eventually not have enough space in the view to display buttons for all descendants … So, if the category.id is equal to 1, 2 or 3, I would like to display only the children of given category … However, for all other category objects (with category.ids of 4 and beyond …), I would like to display all the descendants of a given category. Does anyone have any suggestions on accomplishing, by iterating thru such objects, maybe by using an if else statement using ruby? Any and all recommendations would be greatly appreciated. thank you. |
tiny tds returning a dead connection object? Posted: 15 Sep 2016 07:39 AM PDT I am using |
How to protect visible email address from spam with gem for Ruby 4? Posted: 15 Sep 2016 07:54 AM PDT I'd like to obfuscate an email address on my webpage. I'm hoping to avoid JS in case my users deactivate it. I found this gem: actionview-encoded_mail_to but it doesn't seem to work for me. It shows the full email address on the page (which is good), but it also shows it in the console. I tried the 3 examples with the same result. The gem appears in my Gemfile so should be correctly installed. |
Rails trying to get external database info with ActiveRecord::Base.connection_config Posted: 15 Sep 2016 07:32 AM PDT I have a connection to an external database (In addition to the rails database). I want to be able to show the connection information except for the password in a view.
However, my external table is How do I get the info for that connection/db to show as it does for the default rails db? |
Rails Polymorphic associations with name space Posted: 15 Sep 2016 07:25 AM PDT I want to save different results(default and manual), each result can have a reason. Thought that this would be a good place for a polymorphic association. The Models are namespaced however and this is prooving to be tricker than anticipated. following the guide app/models/event/reason.rb app/models/event/result.rb app/models/event/manual_result.rb But if I try do something like: or It would seem it is expecting the associations to be nested within an additonal layer |
Searching an external API through a rails form and displaying the results in the view Posted: 15 Sep 2016 08:54 AM PDT I need to search data (tutorials) from an external API with 2 params (tag and device) provided by a form in my rails app. In my routes I have: Here's what I think I should put in my I'm not sure how I would organize my code and where I should pass the API calls. Here's my view, rails doesn't recognize the Can anyone help me please ? :) |
Rails 5 Nested attributes "Unpermitted parameter" - Whitelisted Posted: 15 Sep 2016 08:50 AM PDT Error: Unpermitted parameter: properties I'm whitelisting the properties{} in the request_controller.rb This usually works but not this time. I'm not been able to save some of the data entered in a form. The 3 fields that are not saving are coming from a dynamic form "request_type". I followed Rails Cast episode 403 for this solution, which I have working well in another project but not in this one. Source: http://railscasts.com/episodes/403-dynamic-forms Sorry if this is a duplicate question, but I've looked at several other questions and I can't pin-point what I'm doing wrong here I've researched several questions here, but I'm still not able to get it to work: I'm omitting some stuff to make it easier to read the code. Please ask me if you need to see more. Here's the log: Update If I change the request_params to this: See: properties:{} I get this Error: request_controller.rb models/request.rb models/request_type.rb models/request_field.rb views/requests/new.html.erb |
Posted: 15 Sep 2016 07:02 AM PDT My main objective is for an |
Post JSON body in rspec controller test in Rails 5 Posted: 15 Sep 2016 07:01 AM PDT So I'm trying to create a controller test that posts the form data. I'm doing this because there is a bug in RSpec (or maybe it's Rails) right now where nested parameters aren't being processed correctly, so I'd like to just post the data in the body as JSON. so if I have Where params is a hash, it doesn't work since the parameters aren't getting processed correctly, you can try it out yourself but basically for some reason the details in the third question get put into the second question. I feel like if I can just pass the data directly as a JSON body though this bug won't come up since it's pretty hard to mess up parsing JSON. |
Posted: 15 Sep 2016 08:12 AM PDT I'm building an events app using Rails. On my index page each event is represented by a relevant image upon which the event title and date are transposed upon it. Like this - Ideally, I would want a user to input a title for their event which is 'to the point'/ 'succinct' however there's no real way I can control this nor would I want to. When I try and input an overly long title this happens - I need the text to flow and for the title (and date) to be absolutely centred in the middle of the image.At the moment its breaking (as shown below) and clinging to the left.This is my relevant code I have at the moment - events.index.html.erb events.css.scss I'm using the bootstrap gem but not sure whether this is relevant for this issue. Any assistance is appreciated. |
Rails 3 Nested attributes get label and type dynamically Posted: 15 Sep 2016 06:53 AM PDT AppKey.rb AppKey Table Example: AndroidAppKeys.rb AndroidAppKeys Example: Name contains the reference of the of the AppKey table App App.rb
example "display_type" will be mentioned in AppKey table. |
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint Posted: 15 Sep 2016 06:53 AM PDT I am using devise(4.2.0) in rails(4.2.6). In my appication i use nested attributes in user and profile table. I need to validate the password, only if i create the new record and the password field is not validate when i update the created records. my user.rb file is When i run my application this error is occurred. I searched this issue but i am not get a idea to solve it. User & profile table in schemafile |
Can not create new user record on Rails api via Postman Posted: 15 Sep 2016 07:28 AM PDT I am creating new api app via Ruby on Rails. So i am using The problem when i test the api by send the request via Postman, it can not passed my model validation. So this is my controller This is the data that i send to server via Postman And i also set the header to be application/json like this But when i click send i got errors because it can not pass my validation like this This is my model So how can i make the Postman works? It seems like the server cannot read my username, fullname and grade record. Thanks! |
How to handle object list request Posted: 15 Sep 2016 06:41 AM PDT I am trying to read a list of objects How to handle that types of request? |
How to test disabled field in ruby on rails and assert_select? Posted: 15 Sep 2016 06:19 AM PDT I want to test presence of disabled field generated in rails(5) view helper it creates HTML It should be probably just but it is OK and do the job. In Firebug I verify that CSS selector is But when I use it in controller(+view) tests I get error Is there any way, how to test that input selected by ID is disabled? |
An error occurred while installing pg (0.18.4), and Bundler cannot continue Posted: 15 Sep 2016 05:56 AM PDT I encounter the following error while running Ruby 2.3 is installed but ruby 2.2.2 is being used through RVM - The issues are included below Any help would be greatly appreciated |
Twilio - The requested resource not found error. when sending sms messages Posted: 15 Sep 2016 05:41 AM PDT When I send any message it gives an error. |
How to skip inner Rails realisation when debugging with Pry? Posted: 15 Sep 2016 08:34 AM PDT When we are debugging behaviour between different classes, sometimes Pry diving into inner Rails classes (like What is the best way to skip this code and to debug only through your application code? PS: help me please to make a proper title for this question if this one is not clear enough. |
Updating rendered partial variable via ajax in Rails Posted: 15 Sep 2016 05:56 AM PDT I'm rendering a partial that contains a collection_select that uses a variable as a collection object. Is there any way to update this variable via ajax? |
How to post to multiple job boards from my job board - Ruby on Rails Posted: 15 Sep 2016 05:22 AM PDT I have been thinking about this question/topic for a while now and I have not been able to factor it programmatically on my Ruby on Rails Job Board. What I like to do
Graphical explanation This picture explains better what am hoping to achieve. What I think of doing
I will appreciate any direction into this. Be it using a particular gem, or code to factor this. Thanks. |
You are subscribed to email updates from Newest questions tagged ruby-on-rails - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment