Display Last Child in React Iteration | Fixed issues |
- Display Last Child in React Iteration
- Any good pattern library creator thats compatible with rails/reactjs?
- NoMethodError: undefined method `in_time_zone' for nil:NilClass
- Rails 4.2: After manual changing of model name Rails server complains about helpers for the old model
- Rails engine: NameError: uninitialized constant Active****. Using require 'active_***' acceptable?
- MD5 for entire asset pipeline?
- Rails Postgres hstore or jsonb to store many to many relations
- Uninitialized constant Mysql
- Update table from database using ajax in rails
- Trying to send email with gmail stp (rails)
- Rails 4: some of params missing on form_tag after submitting
- Import data from csv file to postgresql database in rails
- Loop through rails associations
- Error While installing rails, i18n requires Ruby version >= 1.9.3 [duplicate]
- Push parallelization stop randomly on heroku
- Amazon - pictures are disappearing
- When setting up a new rails app with devise and activeadmin the schema.rb ends up empty
- Mass assign error
- Adding input with simple_form to get <datalist>
- Rails create File with content type text/xml
- How do I prevent devise from storing sessions when basic auth is used?
- Checking a table for time overlaps
- How to save the return customer data with stripe
- param is missing or the value is empty rails controller
- Needs refresh in order to display created items
- Regarding masking urls in ruby
- SEO friendly urls containing / in Rails
- undefined local variable or method `author' for #<AuthorsController:0x94c5ee8>
- Event layout design ruby [on hold]
- Rails nested form Unpermitted parameter
Display Last Child in React Iteration Posted: 16 Jun 2016 07:55 AM PDT I'm trying to implement a message app, without ActionCable for now. When I map over all messages, I want to show only the last message from that user: instead of showing all messages, from a user, I only show the last. I do not know how to achieve that. I thought I could set the This component is on the index page and I'm trying to create a message-like app. Any pointers with React? Rails 5 is used as back end.
Back end: Message model:
|
Any good pattern library creator thats compatible with rails/reactjs? Posted: 16 Jun 2016 07:57 AM PDT Could anyone recommend a good UI component library generator that would work well with rails for showcasing css and react ui components? I've been trying to get https://github.com/kadirahq/react-storybook to work with my current rails/react project, but ultimately couldn't share compiled css files from my rails asset pipeline with the server used in react storybook. |
NoMethodError: undefined method `in_time_zone' for nil:NilClass Posted: 16 Jun 2016 07:26 AM PDT I am trying to insert data into my TimeSlot table. Overtime I run the code, I get this error "NoMethodError: undefined method `in_time_zone' for nil:NilClass" Here is the code for inserting data: Here is the function for time_zone in the model Please help. |
Posted: 16 Jun 2016 07:10 AM PDT I'm working on Rails4.2/mongoid application. I needed to change the name for one model and did it manually. I'm confident that there is no mention of the old model name in any of the files, checked over and over again manually and then with grep. Also changed the collection name in MongoDB Attempt to open any url on the application results in
Application trace point's to
There is no mention of any models/controllers/helpers in the above controllers. These are the only two inheriting from I found a similar question, but can't say I like the solution. Can anybody at least point me in the right direction? Really stumped with this one. |
Rails engine: NameError: uninitialized constant Active****. Using require 'active_***' acceptable? Posted: 16 Jun 2016 07:19 AM PDT I'm working with a rails engine which uses ActiveRecord/ActiveJob and getting an error: To fix this, within the engine.rb I added a require e.g. However it has been suggested to me that this is a bad way to solve the problem and that an alternative is to check that the Constant is defined instead within the affected method call. e.g. if defined?(ActiveJob). I am less happy with that solution. Can anyone suggest any resources that discuss this, suggest why 'require' may be bad, or suggest alternate solutions? EDIT: I should state that both solutions actually fix the problem; its as much a matter of understanding why within a Rails engine the Rails classes (e.g. ActiveRecord/ActiveJob) are not available unless explicitly required (which I suspect is simply that an engines dependencies are not autoloaded) and how 'best' to make them available within the engine itself. |
MD5 for entire asset pipeline? Posted: 16 Jun 2016 06:59 AM PDT Is there any sort of MD5 hash or cache key generated by the asset-pipeline that represents all the files in the assets folder? I'm looking for a way to know when assets have been added, removed, or updated between deploys. |
Rails Postgres hstore or jsonb to store many to many relations Posted: 16 Jun 2016 07:42 AM PDT There is a table 'Products' with columns (id, tile, price, description, shop_id, timestamps) Column price and shop_id are dynamic. The rest of column are static. Also there is a table 'Shops' with columns (id, name, timestamps). Shop has many products. Product can migrate among all shops and products.shop_id can be blank. I want to have history about which products a shop had. For example, yesterday shop had products and their prices. Day before yesterday shop had other products and/or other their prices. So I want to have something like 'ShopHistory' (id, data, date, timestamps), where data is hstore or json. So it should have hash like { key: value}, where key is id of product and value is its current price. But I would like to joins data column with products in order to know about title and description of products. I have no idea how to do that. It looks like ShopHistory is a join table between shop and products, but all information are stored in one row. Could we help me? Maybe anyone knows a better way to implement all of this. Any thought and articles are welcome. Thanks! P.S. I use rails(ActiveRecord) and PostgreSQL, but answers from guys who know only Postgres are good for me too. |
Posted: 16 Jun 2016 07:20 AM PDT I'm working on a web service to access my database via mysql, but I keep getting this error : NameError - uninitialized constant Mysql When I created the Database, i did not add a password to it. I am using Microsoft SQL Management Studio. To test the web service i am using Advanced REST client. This is my code |
Update table from database using ajax in rails Posted: 16 Jun 2016 07:07 AM PDT I have a problem. I want update my table data from database with selected value's for select box (dropdown). And i think ajax is solution. But how can i do it? and here is my table and my controller looks like I mean when i select 4 in dropdown, table data reloaded with April data from database. |
Trying to send email with gmail stp (rails) Posted: 16 Jun 2016 06:51 AM PDT I'm trying to send some emails from my web application. Here is my configuration : . . . so to test it, i runned this commande from the rails command: ContactMailer.send_email and i'm getting this result : Unfortunatly, after checking my email, i don't receive the email :( |
Rails 4: some of params missing on form_tag after submitting Posted: 16 Jun 2016 06:13 AM PDT In our Rails 4 app, there is a When the After clicking Obviously all |
Import data from csv file to postgresql database in rails Posted: 16 Jun 2016 06:08 AM PDT I have tried the following for importing data from csv file in rails but couldn't understand where I have to use the particular code and how to save particular db column with specific columns of CSV. And where should we keep the csv file to be imported. Can we give path like /Downloads/users.csv in File.read()? And what if the field in csv file is referenced by another table and can we use like the following: Can we use something like this? I have referred the following link but couldn't understand completely. Ruby on Rails - Import Data from a CSV file |
Loop through rails associations Posted: 16 Jun 2016 06:19 AM PDT 1)I'm trying to create a site that has several restaurants each having their own unique menu being displayed in a table, the association works in the console but not in code.I loop over the @restaurant instance variable then in the table I put the data I want from the menu so restaurant.menu.dish but getting an error that 'each' is undefined even though I didn't state a one-one relationship.How may I carry out the desired behavior? 2) How do I ensure that the menu data corresponds with the right restaurant,I'm assuming that the show controller saves the restaurant variable with a specific ID and calling a method like .dish would know what restaurant based on the show action variable, is this correct thinking? Restaurant Model Menu Model Restaurant controller with show action Show.html.erb |
Error While installing rails, i18n requires Ruby version >= 1.9.3 [duplicate] Posted: 16 Jun 2016 07:48 AM PDT This question already has an answer here: I am working on a project that requires Ruby 1.8.7 and Rails 3.1.1. I used RVM to install Ruby and it was installed fine. But, when I try to install Rails, It is throwing an error: Can someone please help? |
Push parallelization stop randomly on heroku Posted: 16 Jun 2016 07:36 AM PDT I want to send a push campaign to all my users (around 500k), but the heroku dyno stop randomly during the execution (no exception raised). I am using the gem Parallel : In all the cases I tested, the process stops at the end of a batch, but I can't find a pattern when playing with The I use a performance-l dyno with 14GB RAM |
Amazon - pictures are disappearing Posted: 16 Jun 2016 05:55 AM PDT I have an app, that use Amazon S3 as a picture storage. My is: Ruby on Rails + MongoDb + Carriervawe + Fog + VDS. Sometimes pictures, that belongs to some model class, just disappear from Amazon. E.g., I have model Gallery has_many :photos. Sometimes all photos within 1 gallery lost all pictures. Meanwhile, all links to S3 (that are generated by carriervawe and fog) are present! It happens with different models and there instances. And it happens rarely - maybe once per month/2 months. My ideas are:
Any ideas? Thank you for your help! |
When setting up a new rails app with devise and activeadmin the schema.rb ends up empty Posted: 16 Jun 2016 06:02 AM PDT I have now set up around 3-4 rails apps using Rails Composer:
Then at some point during the setup running I always have to restart my computer and run I have no idea why this problem occurs but I think it's related to devise and active admin (which in turn uses devise as well). The problem only occurs during the setup and I usually don't have that problem again. The Why does this occur? |
Posted: 16 Jun 2016 07:43 AM PDT In my form, I have the following (using slim): This is generating the following error: In my routes.rb, I have: Isn't this syntax allowed under Rails 3.2? Solution:I solved it by doing: |
Adding input with simple_form to get <datalist> Posted: 16 Jun 2016 06:02 AM PDT I am trying to use simple_form to generate an input textfield with collections, equal to |
Rails create File with content type text/xml Posted: 16 Jun 2016 05:38 AM PDT I create an xml file with: to attach this file via paperclip to my model. The resulting file has the content type "application/xml" but I need the content type "text/xml". Is it possible to set or to manipulate the content type of an file or during the file creation? Thanks a lot. |
How do I prevent devise from storing sessions when basic auth is used? Posted: 16 Jun 2016 05:35 AM PDT Disclaimer: I am a relatively novice RoR developer. My rails 4 web app supports a RESTful API. I am using devise, and the API authenticates with basic auth without any use of keys/tokens (so basic auth must be used on each request). It works fine, except for this: If you are logged out and hit the API in the browser it stores a session, so then if you go back to the web app, you are logged in. This is not the behavior I want. The user should be redirected to the sign-in page when they hit the API and then hit the web app (unless they were already logged in to begin with). So how to I prevent devise from storing a session when basic auth is used? Relevant code: In the application controller I have: And in devise.rb I have: |
Checking a table for time overlaps Posted: 16 Jun 2016 05:20 AM PDT I have a problem with my custom validation. There is individual_trainings table. I want to create validation method that checks if client has another training on the same day and time start_on, end_on overlaps with another training throw error. There is a problem with this method, because if new date and time is correct(not overlap), create method passes and add new training in database.but also there is a alert error message, that term is already busy. How to fix it? |
How to save the return customer data with stripe Posted: 16 Jun 2016 05:17 AM PDT I am using payola which is a rails engine for stripe payment. I am using the subscriptions method to make subscription. Currently users are able to make subscription and can save the data on stripe. How do I save the return data to my database? |
param is missing or the value is empty rails controller Posted: 16 Jun 2016 06:03 AM PDT I have a 3 views, with create form, but a sample def new def create works good, but other def not works... RateFormController.rb 127.0.0.1:3000/rate_form/encreate
|
Needs refresh in order to display created items Posted: 16 Jun 2016 07:05 AM PDT I am working on a simple tool that adds budgets to teams. It works similar to a to do list. The delete function works without reloading but the create function needs a refresh (the data gets added to database fine). This is the create.js.erb This is the partial: _budget.html.erb This is the budget controller: |
Regarding masking urls in ruby Posted: 16 Jun 2016 04:44 AM PDT I am developing an application in ruby on rails , here i want to pass parameters in the URL itself.so my URL looks like "localhost:3000/deals?category_id=1&city_id=1".But i want to just show |
SEO friendly urls containing / in Rails Posted: 16 Jun 2016 04:42 AM PDT I am currently working on transferring pages from a wordpress to a new Rails application to save time on reindexing i would like to keep same url structure These urls contain / There for having a page with slug /p/chapter/part/section gives me /p/chapter%2Fpart%2Fsection in the url after rendering I know module URI is available but i simply dont know how to implement it what i have dont to achieve Slug style url is Pages controller and Pages model routes if anyone could help it would be very much appreciated. |
undefined local variable or method `author' for #<AuthorsController:0x94c5ee8> Posted: 16 Jun 2016 06:56 AM PDT I am trying to submit information into a PHP database and I am getting this error. authors_controller.rb when I click on submit button the error pops up. |
Event layout design ruby [on hold] Posted: 16 Jun 2016 05:03 AM PDT I'm creating an web app for selling online tickets.The user will be able to design a seating chart. Each seating chart has a collection of seats. These seats can be assigned unique numbers or names. You can organize seats into larger groups, such as rows, sections, or levels. So will be something similar to https://www.ticketlight.co.uk/seating-map-editor |
Rails nested form Unpermitted parameter Posted: 16 Jun 2016 04:30 AM PDT When i create or edit product, my merchant_product_detail will not be created or edit due to
product.rb merchant.rb merchant_product_detail.rb product_controller.rb _form.html.erb |
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