routing error for nested resource with ledermann-rails-settings | Fixed issues |
- routing error for nested resource with ledermann-rails-settings
- Rails Dynamically return today's date at runtime
- Ruby on Rails: Call Model method in view
- Overwriting sqlite database - rails
- Ruby TZInfo and Rails ActiveSupport::Timezone UTC_offset differences
- How to create a form that will create a tree of anwers and questions
- Rails Tutorial static pages routes test red (5.28)
- Ruby On Rails Flash.each creating curly brackets on page, not going away
- syntaxt error on rake asset precompile for production
- Sass-Rails @import, do global imports have to be imported in each stylesheet or just application.scss?
- Rails Sidekiq Redis long operation due to brpop
- Can I consume Navision Web Services (Odata / SOAP) using Ruby On Rails?
- Custom ActiveJob Class for ActionMailer
- Conditional content based on url
- Get current status of a delayed job in Sidekiq (through Active Job?)
- Figuring Out How To Access Methods
- Active Record Relation for Assigned and Created
- Save data from api (but just once)
- Rails redirect sending me to localhost:3007
- How to avoid Mongoid (or MongoDB) replacing empty arrays with null
- Rails Console - Group By count and display referenced column value
- Make read-only column in spreadsheet using spreadsheet gem
- How to fetch all associated grand children records?
- Rails prevent column from breaking
- Putting an Ember partial inside Rails view
- rails has_one association preventing adding new child object if exists
- Rails 4 Concurrency Issue - After Unlocking Record & Reloaded Attributes
- devise edit form with bootstrap
- AWS OpsWorks use file as an Environment Variable
- nested forms with pre populated data
routing error for nested resource with ledermann-rails-settings Posted: 01 Jul 2016 08:22 AM PDT I'm trying to allow users to update preferences from default settings with a form for ledermann-rails-settings. I got the form built based on this answer, but when I try to submit the form to update settings, I get a routing error that I think is related to nested resources, but I'm new to RoR so I'm not sure. Other questions about this on SO appear to use Rails 3 or a previous version of the gem. I'm using rails 4.2.1. routes.rb: rake routes: the form: SettingsController: User.rb: Submitting the form as-is right now gives the following routing error:
I think I understand the Rails Guides for nested resource forms to mean that the first line of the form should be something like but changing that gives the error
Additionally, ledermann-rails-settings doesn't appear to have a method for calling all settings (at least so far as I can tell on the current version of the gem), so I'm not sure how I would even define @settings. I've tried specifying different paths in the form with no luck, as well as trying resource: setting and resources: settings in routes.rb. I feel like I'm missing something at either the controller or routes level, but I don't have enough experience to know where and the gem docs and issues don't have much on forms. |
Rails Dynamically return today's date at runtime Posted: 01 Jul 2016 08:18 AM PDT For demonstration purposes: say I am including in the module I am wondering if using that mixed in method of I want the method Example: Say I boot up the server today, The server continues running and it is now I want to ensure that it will not return this: Question: Will my implementation return a dynamic date? If it will not return a dynamic date: how would I do that with that mixed-in method |
Ruby on Rails: Call Model method in view Posted: 01 Jul 2016 08:28 AM PDT I am trying to achieve Paypal integration with rails. Following this (http://railscasts.com/episodes/141-paypal-basics) I have a function in model which call paypal service with a return url. I have added a link in view that links to method in model.But some how rails is not able to get function in model. What am i doing wrong? My View : My Model : defined following function. end Error : Rails.root: C:/Users/Suniljadhav/Source Code/TrainStation |
Overwriting sqlite database - rails Posted: 01 Jul 2016 08:13 AM PDT I have created a model for an app. I'm trying to overwrite the existing database (blank) with another that has some information. When I look into the database, there are several items. However when I try to load those in a page I get an error saying - there are pending migrations, run db:migrate. After doing that the entire database is wiped out and replace by a blank database. Can someone help me out with this? |
Ruby TZInfo and Rails ActiveSupport::Timezone UTC_offset differences Posted: 01 Jul 2016 08:15 AM PDT I want to find the total UTC offset from a Timezone Object. Below are two examples using Why does |
How to create a form that will create a tree of anwers and questions Posted: 01 Jul 2016 07:48 AM PDT I am trying to build a form in my rails app that will generate a tree of answers and questions.The form will be asking the users for the different questions and answers in order to build the tree. On the first node of the tree, there is a question. This question has_many potential answers. Then on the next nodes, if the branch is finished there is just a final answer. Otherwise there is an answer and a new question linked to this answer that in turn might have several answers. So I have answer has_one question I am a bit lost on how to build that form. I believe I should get a JSON that looks something like that when the form is submitted :
Here we have a tree with the initial question "qui a tué henri" that has two possible answers "Jacques" and "Paul" that in turn each have one question.... I have thought about something like: Of course it will then be necessary to have JS that dynamically inserts and removes inputs to the form to be able to add infinitely nodes of answers and questions but I put that appart for now and am just trying to understand the basic logic on how to build such a form. What would be the correct way to write an html form that will enable to build such a tree structure ? |
Rails Tutorial static pages routes test red (5.28) Posted: 01 Jul 2016 07:51 AM PDT Doing Michael Hartl's Rails Tutorial, but stumped on Listing 5.28 (getting RED test instead of GREEN), changing the test to match the new routes. ERRORS for all pages (/, /about, /contact, /help): routes.rb tests/controllers/static_pages_controller_test.rb static_pages_controller.rb Let me know if you need to see any other code! Have tried adding as: '*' after each get route, but to no avail. Not sure if it is a ruby/rails version issue, but I am using Rails 4.2.2 and Ruby 2.3.0 on an IDE, but "rails test" (as Hartl instructs to use) won't work (kicks back "test Command not found"). Not sure if that's a hint to a bigger problem or unrelated. Thanks in advance! EDIT: Links using these paths (like below) are rendering correctly, it is just failing the tests. |
Ruby On Rails Flash.each creating curly brackets on page, not going away Posted: 01 Jul 2016 07:48 AM PDT I am currently taking a course on Ruby on Rails and it is going well, but when i get to doing a flash.each (code below) i keep getting {} showing up on my actual page, only when i delete the line of code does it go away.. I have not a clue why That is the code that is in my Application.html.erb file they connect with this The success and danger are bootstrap classes btw... On top of the rouge {} just chilling on my page i get a {"success"=>"Message Sent"} appearing below my Message Sent notice... I am stumped and while i can live with it like that, I do not want to go half on my first rails app.. All help is appreciated.. I will link the website so you can see what I am talking about, I will leave the server running as long as i can, to see the {success => message} just fill out a fake name email and comment and click submit... Thanks so much https://udemy-rails-coder-nohashkang.c9users.io/contacts/new |
syntaxt error on rake asset precompile for production Posted: 01 Jul 2016 07:39 AM PDT I am trying to push my app to heroku, When I am doing I am getting
Not able to figure out the exact issue here. Can someone help me out. |
Posted: 01 Jul 2016 07:30 AM PDT In our current project app, I hope to eventually get to cleaning up our CSS/SASS assets. As I was reviewing what we have, we have tons of @imports all over our files, i.e. some global variables are contained in an seperate file and we import that file in several other stylesheets at the top. However, in our A snippet from my Gemfile.lock. |
Rails Sidekiq Redis long operation due to brpop Posted: 01 Jul 2016 07:25 AM PDT Newrelic monitoring on fresh Ruby on Rails application with Sidekiq, and not much logic yet implemented and not much trafic is showing that Redis is taking long time (around 2s-3s) on why is that? is that an issue in terms of performance? |
Can I consume Navision Web Services (Odata / SOAP) using Ruby On Rails? Posted: 01 Jul 2016 07:25 AM PDT I am trying to consume Web Services (NAV 2016) using Ruby on Rails but stuck at a point when hitting the (SOAP) URL system returns an HTTP authentication error. Does any one have idea or any links for same. Any help appreciated. Thanks, kapil |
Custom ActiveJob Class for ActionMailer Posted: 01 Jul 2016 07:15 AM PDT In my rails application I'm using How can you instruct actionmailer to enqueue your jobs using a custom class? |
Conditional content based on url Posted: 01 Jul 2016 07:13 AM PDT I'm looking to show content based on whether a certain tracking url was used to access the page. I have looked into request.referrer, but can't seem to get it to function. What is the best way to show/hide content using rails for example Hide for: www.yourcompany.com/web Show for: www.yourcompany.com/web?test |
Get current status of a delayed job in Sidekiq (through Active Job?) Posted: 01 Jul 2016 07:04 AM PDT I use rails 4.2.5 and Sidekiq for background processing. There is an API which an application can call. I now have this code: I get a job_id back like this: ef95bdd9cf5da0ef1273db6c Now I want to expose this status through the API: Sidekiq::Status: this doesn't work, but my question is, how can I get the status from Active Job of a job (queued, progress, completed, ...)? |
Figuring Out How To Access Methods Posted: 01 Jul 2016 07:38 AM PDT I have an advertiser model and an experiment model. I've setup the associations as follows: The experiments table has a column titled "experiment_type", which can either be AOV or Conversion. I am trying to display experiments for the particular advertiser by experiment_type. I can successfully display ALL of the experiments by advertiser with the following iteration Or I can successfully display all the experiment_type with the following iteration What I cannot figure out is how to show the experiment_type by advertiser. I thought something like
The aov action within my experiments controller is Any help would be appreciated. Thanks in advance. |
Active Record Relation for Assigned and Created Posted: 01 Jul 2016 07:35 AM PDT I currently have a working Active Record association but I was wondering if there was a more efficient way of doing something like this. Basically I have a model called Task. A task has one creator and can be assigned to many people. The user model is a Devise Model called User. This is my current setup but I don't like the query I need to use to fetch all Tasks for a user whether they created them or were assigned to them. Here are my models. My current setup is also terrible with pagination. Any suggestions? So basicslly a Task has to have:
|
Save data from api (but just once) Posted: 01 Jul 2016 07:33 AM PDT I would like to save the data from the API, but just once. Currently it's saving data each time I reload my page, so I have the same entry lot of times... I just want to save new one if they are. When I try to add validation to avoid this I get this error :
This is my code : schema : conference.rb: conferences_controller : index : |
Rails redirect sending me to localhost:3007 Posted: 01 Jul 2016 06:23 AM PDT I'm working on a Rails application and i'm having the following problem. I'm using a gem called Wicked. Basically what the gem does is allow the programmer to define steps in a controller and for each step in the show action of that controller render a different view. Something like these So, you have steps one, two, three, four and you request something like "my_controller/one" that takes the :id as "one" in the controller and renders one.erb for example. All cool for now. BUT When i call the redirect_to like in the code above it redirects me to localhost:3007/my_controller/four. Yes, port 3007 instead of 3000. And obviously my site can't reach that URL. I already checked if i have another server fire up or another process that could be bother and generating this redirect going to port 3007. But it wasn't the case. Is just this redirect that sends me to 3007. Any other request goes just fine to port 3000. Any one with a similar problem sometime? Thanks My Rails version is 4.2.6 |
How to avoid Mongoid (or MongoDB) replacing empty arrays with null Posted: 01 Jul 2016 06:20 AM PDT Background: I have built an API in Rails and a client in Angular. My API will connect to a third party API and grab some data. This data will come in as an nested object/hash which is stored in MongoDB/Mongoid. When my Angular clients manipulates the data and send it to my API to save it, all empty arrays within the nested hash/object are replaced with Is there a way I could avoid this from happening (other than manually converting all the |
Rails Console - Group By count and display referenced column value Posted: 01 Jul 2016 06:18 AM PDT I have 2 models, How can I get the output like the output should be This is what I have tried. Result is |
Make read-only column in spreadsheet using spreadsheet gem Posted: 01 Jul 2016 06:05 AM PDT I have used spreadsheet gem to generate How to do with spreadsheet gem? |
How to fetch all associated grand children records? Posted: 01 Jul 2016 06:40 AM PDT How to tell ActiveRecord to fetch all |
Rails prevent column from breaking Posted: 01 Jul 2016 08:23 AM PDT In Rails, I have a table with four columns. I want two of the columns to essentially never break if at all possible. I want the other columns to shrink and continue breaking while these two remain the same. Currently, shrinking my window simply causes all of the columns to break at the same time and shrink the table to half its size, and it ends up much smaller than the screen. I've tried using col-sm-2, col-md-2, etc. but these aren't changing the breakpoint for me at all. Essentially my issue is that all of my columns break at the same point, which is behavior I do not want |
Putting an Ember partial inside Rails view Posted: 01 Jul 2016 05:21 AM PDT I have an application in Rails. Recently Ember was installed, and is being used on the part of the views. It works fine there. Now, I need to add some ember functionality to the navbar. At the moment navbar is the part of the Rails layout. I've never dealt with ember before, I've only read some tutorials. The first solution I've found so far is rewriting and moving the navbar from Rails layout to Embers layout. But that seems like a lot of work, and I'm not sure if it is a good idea. There is also a way, of puting a div named, for example, "ember-app" and root the Ember there. But that works for a whole ember app, and I want only a part in navbar, and something else in the body. Essentially, what I would like to do, is something like this Is it possible? There are some ember partials things I've found, but they work inside embers app. Maybe moving the navbar into embers app is normal things? |
rails has_one association preventing adding new child object if exists Posted: 01 Jul 2016 05:11 AM PDT In my rails app I have I can prevent this with pundit (authorization gem) and authorize only users who don't have profile to be able to trigger new and create actions. I was wondering though what's the rails convention was in this case. I guess there should be a simpler solution. |
Rails 4 Concurrency Issue - After Unlocking Record & Reloaded Attributes Posted: 01 Jul 2016 04:57 AM PDT I am having hard time understanding the reason why my model is behaving like this. It's taking an unexpected behavior that I would like to understand the reason. I have 2 actions, cancel and feature, when attribute was already canceled it can't be featured. To ensure that a feature is not performed on a canceled attribute I am using RedisMutex to lock and make the proper verifications inside the block, when the lock is made and is exclusive: I have the similar logic on the cancel action - locking with redis-mutex and making the verifications inside the lock. I want to understand how is it possible that sometimes (rare) the attribute is first canceled and then featured - the other way feature and then canceled may also occur just I haven't detecte dit |
devise edit form with bootstrap Posted: 01 Jul 2016 07:36 AM PDT In my edit view, I want to apply bootstrap. However, when replacing... with this... I have tried many alternatives to include erb but don't understand the issue. How should I include the field in my edit forms? |
AWS OpsWorks use file as an Environment Variable Posted: 01 Jul 2016 05:26 AM PDT Cheers! Is there any possibility to use File (.pem certificate in my occasion) as an AWS OpsWorks Environment Variable? As far as I could see, AWS OpsWorks allows to set only direct string values through it's console on app's level. Or maybe there are some best practices of storing .pem certificates on AWS that depends on environment? |
nested forms with pre populated data Posted: 01 Jul 2016 03:49 AM PDT I am having an issue managing a has_many :through association via nested form when creating a product i want to display all tags from tags table and create a new record in product_tags table with some extra information is this possible thanks for help Models |
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