I have an eml that has the following charset info.
Content-Type: text/plain; charset="iso-2022-cn"
While reading no issues, but when i write the same eml back to disk, i get the following error, any ideas?
java.lang.UnsupportedOperationException
at sun.nio.cs.ext.ISO2022_CN.newEncoder(ISO2022_CN.java:76) ~[?:?]
at sun.nio.cs.StreamEncoder.<init>(StreamEncoder.java:176) ~[?:1.8.0_161]
at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:59) ~[?:1.8.0_161]
at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:100) ~[?:1.8.0_161]
at com.sun.mail.handlers.text_plain.writeTo(text_plain.java:161) ~[bin/:?]
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:889) ~[?:1.8.0_161]
at javax.activation.DataHandler.writeTo(DataHandler.java:317) ~[?:1.8.0_161]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1486) ~[bin/:?]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:865) ~[bin/:?]
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:462) ~[bin/:?]
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:103) ~[bin/:?]
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:889) ~[?:1.8.0_161]
at javax.activation.DataHandler.writeTo(DataHandler.java:317) ~[?:1.8.0_161]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1486) ~[bin/:?]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:865) ~[bin/:?]
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:462) ~[bin/:?]
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:103) ~[bin/:?]
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:889) ~[?:1.8.0_161]
at javax.activation.DataHandler.writeTo(DataHandler.java:317) ~[?:1.8.0_161]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1486) ~[bin/:?]
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1773) ~[bin/:?]
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1749) ~[bin/:?]
This is a charset which does not support encoding[1] [2], only decoding.
So you'll need to set the output header to UTF-8 when writing out the message.
Related
Here is my template.html.erb loop. I am trying to access the JSON object data. This works, if I use just straight json arrays, ["name","artist","details"] and access it via artwork[0] artwork[1] etc. However, Im trying to use a JSON object and things fall apart.
<% data.artworks.each_with_index do |artwork,index| %>
<div id="<%= slug_text artwork.name %>" class="port">
<div class="port_wrap">
<div class="grid">
<div class="c-50--lap-and-up grid__cell">
<div class="title-box">
<h1><%= artwork.name %></h1>
<h2>By: <%= artwork.artist %></h2>
Im getting "undefined method 'name' for #Array:0x000005584bcd3018 as an error.
Trying to send non-SOAP rate request to FedEx. The following XML works with SOAP Env and Body when I send their SOAP endpoint. It says in the documentation that they offer an XML-only solution, and that is formatted exactly the same as the SOAP request. Sending to https://wsbeta.fedex.com:443/xml. Please let me know if anyone has any insight.
<RateRequest>
<WebAuthenticationDetail>
<UserCredential>
<Key>omitted</Key>
<Password>omitted</Password>
</UserCredential>
</WebAuthenticationDetail>
<ClientDetail>
<AccountNumber>omitted</AccountNumber>
<MeterNumber>omitted</MeterNumber>
</ClientDetail>
<Version>
<ServiceId>crs</ServiceId>
<Major>28</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<RequestedShipment>
<ServiceType>FEDEX_2_DAY</ServiceType>
<Shipper>
<Address>
<StreetLines>4500 WEST 46TH STREET</StreetLines>
<City>CHICAGO</City>
<StateOrProvinceCode>IL</StateOrProvinceCode>
<PostalCode>60632</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Shipper>
<Recipient>
<Address>
<City>TAMPA</City>
<StateOrProvinceCode>FL</StateOrProvinceCode>
<PostalCode>33616</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Recipient>
<PackageCount>1</PackageCount>
<RequestedPackageLineItems>
<SequenceNumber>1</SequenceNumber>
<GroupPackageCount>1</GroupPackageCount>
<Weight>
<Units>LB</Units>
<Value>10</Value>
</Weight>
</RequestedPackageLineItems>
</RequestedShipment>
</RateRequest>
It looks like you're almost there. The root element of your xml document is missing the namespace http://fedex.com/ws/rate/v28.
In a SOAP message the namespace would be defined on the Envelope element. Because the data sent via the plain XML interface does not contain the wrapping Envelope and Body tags that are specific to SOAP, you have to add the namespace to the RateRequest element.
Your request should then be:
<RateRequest xmlns="http://fedex.com/ws/rate/v28">
<WebAuthenticationDetail>
<UserCredential>
<Key>omitted</Key>
<Password>omitted</Password>
</UserCredential>
</WebAuthenticationDetail>
<ClientDetail>
<AccountNumber>omitted</AccountNumber>
<MeterNumber>omitted</MeterNumber>
</ClientDetail>
<Version>
<ServiceId>crs</ServiceId>
<Major>28</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<RequestedShipment>
<ServiceType>FEDEX_2_DAY</ServiceType>
<Shipper>
<Address>
<StreetLines>4500 WEST 46TH STREET</StreetLines>
<City>CHICAGO</City>
<StateOrProvinceCode>IL</StateOrProvinceCode>
<PostalCode>60632</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Shipper>
<Recipient>
<Address>
<City>TAMPA</City>
<StateOrProvinceCode>FL</StateOrProvinceCode>
<PostalCode>33616</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Recipient>
<PackageCount>1</PackageCount>
<RequestedPackageLineItems>
<SequenceNumber>1</SequenceNumber>
<GroupPackageCount>1</GroupPackageCount>
<Weight>
<Units>LB</Units>
<Value>10</Value>
</Weight>
</RequestedPackageLineItems>
</RequestedShipment>
</RateRequest>
Also, don't forget to set the following headers in your request:
Accept: image/gif, image/jpeg, image/pjpeg, text/plain, text/html, */*
Content-Type: text/xml
I am trying to migrate my sample to the lates Spring Data R2dbc 1.0.0.RELEASE.
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
</dependency>
<dependency>
<groupId>dev.miku</groupId>
<artifactId>r2dbc-mysql</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
Schema.sql
CREATE TABLE IF NOT EXISTS posts (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255),
content VARCHAR(255)
);
My initialziation codes failed.
#Component
#Slf4j
class DataInitializer {
private final DatabaseClient databaseClient;
public DataInitializer(DatabaseClient databaseClient) {
this.databaseClient = databaseClient;
}
#EventListener(value = ContextRefreshedEvent.class)
public void init() {
log.info("start data initialization ...");
this.databaseClient.insert()
.into("posts")
//.nullValue("id", Integer.class)
.value("title", "First post title")
.value("content", "Content of my first post")
.map((r, m) -> r.get("id", Integer.class)).all()
.log()
.thenMany(
this.databaseClient.select()
.from("posts")
.orderBy(Sort.by(desc("id")))
.as(Post.class)
.fetch()
.all()
.log()
)
.subscribe(null, null, () -> log.info("initialization is done..."));
}
}
There is an exception when the application is started.
java.util.NoSuchElementException: column name 'id' does not exist in [LAST_INSERT_ID]
at dev.miku.r2dbc.mysql.InsertSyntheticRow.assertValidName(InsertSyntheticRow.java:151) ~[r2dbc-mysql-0.8.0.RELEASE.jar:0.8.0.RELEASE]
at dev.miku.r2dbc.mysql.InsertSyntheticRow.get(InsertSyntheticRow.java:72) ~[r2dbc-mysql-0.8.0.RELEASE.jar:0.8.0.RELEASE]
at com.example.demo.DataInitializer.lambda$init$0(DataInitializer.java:38) ~[classes/:na]
at dev.miku.r2dbc.mysql.MySqlResult.lambda$map$2(MySqlResult.java:98) ~[r2dbc-mysql-0.8.0.RELEASE.jar:0.8.0.RELEASE]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1630) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.MonoProcessor.onNext(MonoProcessor.java:317) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at dev.miku.r2dbc.mysql.MySqlResult.lambda$null$3(MySqlResult.java:115) ~[r2dbc-mysql-0.8.0.RELEASE.jar:0.8.0.RELEASE]
at reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drainRegular(FluxWindowPredicate.java:650) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drain(FluxWindowPredicate.java:728) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxWindowPredicate$WindowFlux.onNext(FluxWindowPredicate.java:770) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.onNext(FluxWindowPredicate.java:228) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:274) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:851) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:203) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:178) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxContextStart$ContextStartSubscriber.onNext(FluxContextStart.java:103) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at dev.miku.r2dbc.mysql.util.DiscardOnCancelSubscriber.onNext(DiscardOnCancelSubscriber.java:65) ~[r2dbc-mysql-0.8.0.RELEASE.jar:0.8.0.RELEASE]
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:242) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:112) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:176) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.EmitterProcessor.drain(EmitterProcessor.java:426) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.EmitterProcessor.onNext(EmitterProcessor.java:268) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:112) ~[reactor-core-3.3.1.RELEASE.jar:3.3.1.RELEASE]
at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:218) ~[reactor-netty-0.9.2.RELEASE.jar:0.9.2.RELEASE]
at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:351) ~[reactor-netty-0.9.2.RELEASE.jar:0.9.2.RELEASE]
at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:348) ~[reactor-netty-0.9.2.RELEASE.jar:0.9.2.RELEASE]
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:89) ~[reactor-netty-0.9.2.RELEASE.jar:0.9.2.RELEASE]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at dev.miku.r2dbc.mysql.client.MessageDuplexCodec.channelRead(MessageDuplexCodec.java:96) ~[r2dbc-mysql-0.8.0.RELEASE.jar:0.8.0.RELEASE]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:326) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:300) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1478) ~[netty-handler-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1227) ~[netty-handler-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1274) ~[netty-handler-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:503) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:442) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:281) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) ~[netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.43.Final.jar:4.1.43.Final]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
The complete source codes is here. In the early version, I was using the jasync based r2dbc-mysql driver, it worked, but after I followed the official doc to use dev.miku:r2dbc-mysql at this time, it failed.
Resovled: Use the index instread of column name, see the comments in this issue
.map((r, m) -> r.get(0, Integer.class))
I am using link_to to try to delete a record, but I'm getting an error saying the delete path does not exist. When looking at the href in the html form, the href is in the form of :id/controller instead of controller/:id. I have two examples of this, one for Edit that seems to work as expected, and one for Remove, where the route seems to be off. The main difference I see is that locale is not being defined on the destroy href. Any ideas on what is causing this issue? I saw this before on a different form, but I am starting to see this much more often. Any help would be much appreciated.
Routes:
topdressings GET (/:locale)/topdressings(.:format) topdressings#index {:locale=>/en|es/}
POST (/:locale)/topdressings(.:format) topdressings#create {:locale=>/en|es/}
new_topdressing GET (/:locale)/topdressings/new(.:format) topdressings#new {:locale=>/en|es/}
edit_topdressing GET (/:locale)/topdressings/:id/edit(.:format) topdressings#edit {:locale=>/en|es/}
GET (/:locale)/topdressings/:id(.:format) topdressings#show {:locale=>/en|es/}
PATCH (/:locale)/topdressings/:id(.:format) topdressings#update {:locale=>/en|es/}
PUT (/:locale)/topdressings/:id(.:format) topdressings#update {:locale=>/en|es/}
DELETE (/:locale)/topdressings/:id(.:format) topdressings#destroy {:locale=>/en|es/}
HTML:
<td><%= link_to t(:edit), edit_topdressing_path(topdressing), data: { toggle: "modal", target: "#EditModal_#{topdressing.id}", remote: edit_topdressing_path(topdressing) + "#modal-edit-form" }, remote: true %>
|
<%= link_to t(:remove), topdressings_path(topdressing), method: :delete, data: { confirm: t(:confirm_remove_topdressing, device: "#{topdressing.topdressing_device.name}", date: "#{topdressing.date}") } %></td>
HREF DETAILS IN PAGE SOURCE
<td><a data-toggle="modal" data-target="#EditModal_1" data-remote="/en/topdressings/1/edit#modal-edit-form" data-remote="true" href="/en/topdressings/1/edit">Edit</a>
|
<a data-confirm="Are you sure you want to delete the record for Device 2 on 2016-02-26" rel="nofollow" data-method="delete" href="/1/topdressings"><span>Remove</span></a></td>
ERROR ON DELETE:
Started DELETE "/1/topdressing" for 127.0.0.1 at 2016-03-05 14:34:06 -0800
ActionController::RoutingError (No route matches [DELETE] "/1/topdressing"):
web-console (2.0.0.beta3) lib/action_dispatch/debug_exceptions.rb:22:in `middleware_call'
HTML FORM details:
Your second link uses the topdressing_path URL helper and passes it one argument:
link_to t(:remove), topdressings_path(topdressing), method: :delete
But your rake routes shows that path only has one placeholder in it, for the locale:
topdressings GET (/:locale)/topdressings(.:format)
You need to use another URL helper instead. In Rails' resourceful routes you'd have a topdressing_path that you could use:
link_to t(:remove), topdressing_path(topdressing), method: :delete
But I'm guessing that's not how you've got your routes set up. Chances are, you've got something like this in config/routes.rb. You can add an as option to give that route a name, allowing you to use it in your link_to helpers in your views:
scope "(:locale)", locale: /en|nl/ do
# Other routes omitted
get "topdressings/:id", to: "topdressings#show", as: "topdressing"
end
I have a HTML document that contains inline OMML. Is it possible to apply XSLT transformations to this inline XML somehow and get back a HTML with MathML? Probably have to use OMML2MML.xsl somehow. After that I could use mathjacx to actually render the equations for display.
<html>
<head>
</head>
<body>
<xml id="sheet1" src="OMML2MML.XSL">
<m:oMath xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
<m:sSub>
<m:sSubPr>
<m:ctrlPr>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:i/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
<w:lang w:val="et-EE"/>
</w:rPr>
</m:ctrlPr>
</m:sSubPr>
<m:e>
<m:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
<w:lang w:val="et-EE"/>
</w:rPr>
<m:t>N</m:t>
</m:r>
</m:e>
<m:sub>
<m:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
<w:lang w:val="et-EE"/>
</w:rPr>
<m:t>3</m:t>
</m:r>
</m:sub>
</m:sSub>
</m:oMath>
</xml>
</body>
</html>
Thanks for any help!
Ok this is what I ended up doing:
Got OMML from Apache POI
Converted that to MathML with javax.xml.transform.Transformer and passing in the OMML2MML.xsl
Removed root node namespace from MathML with plain string manipulation
Directly injected the MathML to HTML
Used mathjax to render the formulas.